Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
0190c9b
Wayland support in Gnome Shell (Experimental/Incomplete)
rcaelers Jun 5, 2021
8fc6c0f
Merge branch 'main' into topic/wayland
rcaelers Feb 25, 2025
430fbee
Merge remote-tracking branch 'origin/main' into topic/wayland
rcaelers May 25, 2025
9b18aa6
Use Gnome Shell to display prelude windows (WIP)
rcaelers May 25, 2025
15c8c2a
Prelude support in GNOME Shell extension (WIP)
rcaelers May 26, 2025
221fa11
Use enum clas instead of enum
rcaelers May 28, 2025
196ee5a
Prelude support in GNOME Shell extension (WIP)
rcaelers May 28, 2025
0babb8f
Fix variable name
rcaelers May 28, 2025
0db65da
Fix compilation on Windows
rcaelers May 28, 2025
ec49b70
Remove compatibility with older GNOME Shell version
rcaelers May 28, 2025
487837e
Properly terminate prelude manager in Gnome Shell extension
rcaelers May 28, 2025
2d7952b
Change style of GNOME Shell prelude to be closer to Gtk prelude
rcaelers May 29, 2025
1c8d300
Make prelude API more robust
rcaelers May 29, 2025
07bb8aa
Correctly use GNOME Shell prelude from Workrave
rcaelers May 29, 2025
48155ed
Correct "void pointer" behavior in GNOME Shell prelude
rcaelers May 29, 2025
16661ed
Improve GNOME Shell prelude robustness
rcaelers May 29, 2025
384a8f5
disable vcpkg CI buildd for now
rcaelers May 29, 2025
316839a
Remove unused images
rcaelers May 29, 2025
441dd6d
Merge remote-tracking branch 'origin/main' into topic/wayland
rcaelers Aug 28, 2025
e200430
Fix CI issue
rcaelers Aug 28, 2025
e7e9ebb
Merge remote-tracking branch 'origin/main' into topic/wayland
rcaelers Sep 24, 2025
2cdf5b4
Merge remote-tracking branch 'origin/main' into topic/wayland
rcaelers Oct 17, 2025
3a63c26
Revert unrelated changes
rcaelers Oct 17, 2025
dc130ec
Merge remote-tracking branch 'origin/main' into topic/wayland
rcaelers Nov 21, 2025
c35e6d0
Remove dead code
rcaelers Nov 21, 2025
1b10a9b
revert changes compared to main
rcaelers Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@ jobs:

build-windows-vcpkg:
name: windows vcpkg
if: ${{ false }}
env:
VCPKG_ROOT: C:/vcpkg
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
runs-on: windows-latest
if: ${{ false }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion changes.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
releases:
- version: 1.11.0-rc.2
date: 2025-05-04T00:00:00+02:00
date: 2025-08-31T00:00:00+02:00
short: |-
Workrave 1.11.0-rc.2 has been released.
changes:
Expand All @@ -14,6 +14,9 @@ releases:
- Fix issue where the status window shows when Sway reloads despite being disabled (#612, #615, wojnilowicz)
- Support user defined colors (#619)
- Phil Dibbs contributed new sounds (bells_ensemble, shangri_la, synth_harp, tinkle_bell, tuned_udu, woodwind_ensemble)
- Optionally delegate break prompts to the GNOME Shell extension.
This prevents focus stealing when a break prompt is shown on Wayland.
This option can be enabled in the general user interface preferences.

- version: 1.11.0-rc.1
date: 2025-01-07T17:49:37+01:00
Expand Down
38 changes: 29 additions & 9 deletions libs/core/include/core/IApp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ namespace workrave
{
public:
//! The stage of a break warning (prelude)
enum PreludeStage
enum class PreludeStage
{
STAGE_INITIAL = 0,
STAGE_MOVE_OUT,
STAGE_WARN,
STAGE_ALERT
Initial = 0,
MoveOut,
Warn,
Alert
};

//! Text that the GUI show must in the prelude window.
enum PreludeProgressText
enum class PreludeProgressText
{
PROGRESS_TEXT_BREAK_IN,
PROGRESS_TEXT_DISAPPEARS_IN,
PROGRESS_TEXT_SILENT_IN
BreakIn,
DisappearsIn,
SilentIn
};

virtual ~IApp() = default;
Expand Down Expand Up @@ -70,6 +70,26 @@ namespace workrave
//! Set the progress text of the prelude window.
virtual void set_prelude_progress_text(PreludeProgressText text) = 0;
};

template<>
struct workrave::utils::enum_traits<IApp::PreludeStage>
{
static constexpr std::array<std::pair<std::string_view, IApp::PreludeStage>, 4> names{
{{"initial", IApp::PreludeStage::Initial},
{"move_out", IApp::PreludeStage::MoveOut},
{"warn", IApp::PreludeStage::Warn},
{"alert", IApp::PreludeStage::Alert}}};
};

template<>
struct workrave::utils::enum_traits<IApp::PreludeProgressText>
{
static constexpr std::array<std::pair<std::string_view, IApp::PreludeProgressText>, 3> names{
{{"break_in", IApp::PreludeProgressText::BreakIn},
{"disappears_in", IApp::PreludeProgressText::DisappearsIn},
{"silent_in", IApp::PreludeProgressText::SilentIn}}};
};

} // namespace workrave

#endif // WORKRAVE_BACKEND_IAPP_HH
12 changes: 6 additions & 6 deletions libs/core/src/BreakControl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,20 +157,20 @@ BreakControl::heartbeat()
else if (prelude_time == 20)
{
// Still not idle after 20s. Red alert.
application->set_prelude_stage(IApp::STAGE_ALERT);
application->set_prelude_stage(IApp::PreludeStage::Alert);
application->refresh_break_window();
}
else if (prelude_time == 10)
{
// Still not idle after 10s. Yellow alert.
application->set_prelude_stage(IApp::STAGE_WARN);
application->set_prelude_stage(IApp::PreludeStage::Warn);
application->refresh_break_window();
}

if (prelude_time == 4)
{
// Move prelude window to top of screen after 4s.
application->set_prelude_stage(IApp::STAGE_MOVE_OUT);
application->set_prelude_stage(IApp::PreludeStage::MoveOut);
}
}
break;
Expand Down Expand Up @@ -648,15 +648,15 @@ BreakControl::prelude_window_start()

application->create_prelude_window(break_id);

application->set_prelude_stage(IApp::STAGE_INITIAL);
application->set_prelude_stage(IApp::PreludeStage::Initial);

if (!reached_max_prelude)
{
application->set_prelude_progress_text(IApp::PROGRESS_TEXT_DISAPPEARS_IN);
application->set_prelude_progress_text(IApp::PreludeProgressText::DisappearsIn);
}
else
{
application->set_prelude_progress_text(IApp::PROGRESS_TEXT_BREAK_IN);
application->set_prelude_progress_text(IApp::PreludeProgressText::BreakIn);
}

update_prelude_window();
Expand Down
17 changes: 15 additions & 2 deletions libs/core/test/IntegrationTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ using namespace std;
using namespace workrave::utils;
using namespace workrave::config;
using namespace workrave;

namespace workrave
{
std::ostream &operator<<(std::ostream &stream, ::workrave::OperationMode e)
Expand All @@ -84,6 +85,18 @@ namespace workrave
stream << workrave::utils::enum_to_string(e);
return stream;
}

std::ostream &operator<<(std::ostream &stream, ::workrave::IApp::PreludeStage e)
{
stream << workrave::utils::enum_to_string(e);
return stream;
}

std::ostream &operator<<(std::ostream &stream, ::workrave::IApp::PreludeProgressText e)
{
stream << workrave::utils::enum_to_string(e);
return stream;
}
} // namespace workrave

#if SPDLOG_VERSION >= 10600
Expand Down Expand Up @@ -631,11 +644,11 @@ class Backend : public workrave::IApp

if (prelude_count[active_prelude] < max_preludes)
{
BOOST_CHECK_EQUAL(text, IApp::PROGRESS_TEXT_DISAPPEARS_IN);
BOOST_CHECK_EQUAL(text, IApp::PreludeProgressText::DisappearsIn);
}
else
{
BOOST_CHECK_EQUAL(text, IApp::PROGRESS_TEXT_BREAK_IN);
BOOST_CHECK_EQUAL(text, IApp::PreludeProgressText::BreakIn);
}

need_refresh = true;
Expand Down
38 changes: 29 additions & 9 deletions libs/corenext/include/core/IApp.hh
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,20 @@ namespace workrave
{
public:
//! The stage of a break warning (prelude)
enum PreludeStage
enum class PreludeStage
{
STAGE_INITIAL = 0,
STAGE_MOVE_OUT,
STAGE_WARN,
STAGE_ALERT
Initial = 0,
MoveOut,
Warn,
Alert
};

//! Text that the GUI show must in the prelude window.
enum PreludeProgressText
enum class PreludeProgressText
{
PROGRESS_TEXT_BREAK_IN,
PROGRESS_TEXT_DISAPPEARS_IN,
PROGRESS_TEXT_SILENT_IN
BreakIn,
DisappearsIn,
SilentIn
};

virtual ~IApp() = default;
Expand Down Expand Up @@ -70,6 +70,26 @@ namespace workrave
//! Set the progress text of the prelude window.
virtual void set_prelude_progress_text(PreludeProgressText text) = 0;
};

template<>
struct workrave::utils::enum_traits<IApp::PreludeStage>
{
static constexpr std::array<std::pair<std::string_view, IApp::PreludeStage>, 4> names{
{{"initial", IApp::PreludeStage::Initial},
{"move_out", IApp::PreludeStage::MoveOut},
{"warn", IApp::PreludeStage::Warn},
{"alert", IApp::PreludeStage::Alert}}};
};

template<>
struct workrave::utils::enum_traits<IApp::PreludeProgressText>
{
static constexpr std::array<std::pair<std::string_view, IApp::PreludeProgressText>, 3> names{
{{"break_in", IApp::PreludeProgressText::BreakIn},
{"disappears_in", IApp::PreludeProgressText::DisappearsIn},
{"silent_in", IApp::PreludeProgressText::SilentIn}}};
};

} // namespace workrave

#endif // WORKRAVE_BACKEND_IAPP_HH
12 changes: 6 additions & 6 deletions libs/corenext/src/BreakStateModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,20 +125,20 @@ BreakStateModel::process()
else if (prelude_time == 20)
{
// Still not idle after 20s. Red alert.
application->set_prelude_stage(IApp::STAGE_ALERT);
application->set_prelude_stage(IApp::PreludeStage::Alert);
application->refresh_break_window();
}
else if (prelude_time == 10)
{
// Still not idle after 10s. Yellow alert.
application->set_prelude_stage(IApp::STAGE_WARN);
application->set_prelude_stage(IApp::PreludeStage::Warn);
application->refresh_break_window();
}

if (prelude_time == 4)
{
// Move prelude window to top of screen after 4s.
application->set_prelude_stage(IApp::STAGE_MOVE_OUT);
application->set_prelude_stage(IApp::PreludeStage::MoveOut);
}
}
break;
Expand Down Expand Up @@ -454,15 +454,15 @@ BreakStateModel::prelude_window_start()

application->hide_break_window();
application->create_prelude_window(break_id);
application->set_prelude_stage(IApp::STAGE_INITIAL);
application->set_prelude_stage(IApp::PreludeStage::Initial);

if (!has_reached_max_preludes())
{
application->set_prelude_progress_text(IApp::PROGRESS_TEXT_DISAPPEARS_IN);
application->set_prelude_progress_text(IApp::PreludeProgressText::DisappearsIn);
}
else
{
application->set_prelude_progress_text(IApp::PROGRESS_TEXT_BREAK_IN);
application->set_prelude_progress_text(IApp::PreludeProgressText::BreakIn);
}

prelude_window_update();
Expand Down
16 changes: 14 additions & 2 deletions libs/corenext/test/IntegrationTests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,18 @@ namespace workrave
stream << workrave::utils::enum_to_string(e);
return stream;
}

std::ostream &operator<<(std::ostream &stream, ::workrave::IApp::PreludeStage e)
{
stream << workrave::utils::enum_to_string(e);
return stream;
}

std::ostream &operator<<(std::ostream &stream, ::workrave::IApp::PreludeProgressText e)
{
stream << workrave::utils::enum_to_string(e);
return stream;
}
} // namespace workrave

using namespace workrave::config;
Expand Down Expand Up @@ -611,11 +623,11 @@ class Backend : public workrave::IApp

if (prelude_count[active_prelude] < max_preludes)
{
BOOST_CHECK_EQUAL(text, IApp::PROGRESS_TEXT_DISAPPEARS_IN);
BOOST_CHECK_EQUAL(text, IApp::PreludeProgressText::DisappearsIn);
}
else
{
BOOST_CHECK_EQUAL(text, IApp::PROGRESS_TEXT_BREAK_IN);
BOOST_CHECK_EQUAL(text, IApp::PreludeProgressText::BreakIn);
}

need_refresh = true;
Expand Down
2 changes: 1 addition & 1 deletion po/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ foreach (po_file ${POFILES})
add_custom_command(
TARGET update-po
POST_BUILD
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --no-wrap --backup=none -s ${po_file} ${POTFILE}
COMMAND ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --no-wrap --backup=none ${po_file} ${POTFILE}
VERBATIM
)

Expand Down
Loading
Loading