Compare commits
No commits in common. "rawhide" and "f41" have entirely different histories.
5 changed files with 221 additions and 50 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -19,6 +19,3 @@ workrave-1.9.1.tar.gz
|
|||
/workrave-v1_11_0_beta_12.tar.gz
|
||||
/workrave-v1_11_0_beta_13.tar.gz
|
||||
/workrave-v1_11_0_rc_1.tar.gz
|
||||
/workrave-v1_11_0_rc_3.tar.gz
|
||||
/workrave-v1_11_0_rc_4.tar.gz
|
||||
/workrave-v1_11_1.tar.gz
|
||||
|
|
|
|||
206
1be2073.patch
Normal file
206
1be2073.patch
Normal file
|
|
@ -0,0 +1,206 @@
|
|||
From 1be2073a41691ff4db909b1b04de465c3e2c92dc Mon Sep 17 00:00:00 2001
|
||||
From: Rob Caelers <rob.caelers@gmail.com>
|
||||
Date: Sat, 22 Mar 2025 17:57:22 +0100
|
||||
Subject: [PATCH] Make muilti-monitor support most robust (#606)
|
||||
|
||||
---
|
||||
ui/app/Application.cc | 16 ++++++++++---
|
||||
ui/app/toolkits/gtkmm/IToolkitPrivate.hh | 3 ++-
|
||||
ui/app/toolkits/gtkmm/MainWindow.cc | 14 ++++++++++--
|
||||
ui/app/toolkits/gtkmm/Toolkit.cc | 29 +++++++++++++++++++++---
|
||||
ui/app/toolkits/gtkmm/Toolkit.hh | 2 +-
|
||||
ui/app/toolkits/qt/IToolkitPrivate.hh | 2 +-
|
||||
6 files changed, 55 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/ui/app/Application.cc b/ui/app/Application.cc
|
||||
index a88e6e49f..f3f7751b0 100644
|
||||
--- a/ui/app/Application.cc
|
||||
+++ b/ui/app/Application.cc
|
||||
@@ -152,6 +152,7 @@ Application::init_configurator()
|
||||
{
|
||||
if (std::filesystem::is_regular_file(ini_file))
|
||||
{
|
||||
+ spdlog::info("Using INI configuration file: {}", ini_file);
|
||||
configurator = workrave::config::ConfiguratorFactory::create(workrave::config::ConfigFileFormat::Ini);
|
||||
configurator->load(ini_file);
|
||||
}
|
||||
@@ -174,6 +175,7 @@ Application::init_configurator()
|
||||
#endif
|
||||
if (!configFile.empty())
|
||||
{
|
||||
+ spdlog::info("Using XML configuration file: {}", configFile);
|
||||
configurator->load(configFile);
|
||||
}
|
||||
}
|
||||
@@ -186,6 +188,7 @@ Application::init_configurator()
|
||||
|
||||
if (configurator)
|
||||
{
|
||||
+ spdlog::info("Using INI configuration file: {}", ini_file);
|
||||
configurator->load(ini_file);
|
||||
configurator->save();
|
||||
}
|
||||
@@ -432,7 +435,11 @@ Application::create_prelude_window(BreakId break_id)
|
||||
|
||||
for (int i = 0; i < toolkit->get_head_count(); i++)
|
||||
{
|
||||
- prelude_windows.push_back(toolkit->create_prelude_window(i, break_id));
|
||||
+ auto prelude_window = toolkit->create_prelude_window(i, break_id);
|
||||
+ if (prelude_window)
|
||||
+ {
|
||||
+ prelude_windows.push_back(prelude_window);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,8 +486,11 @@ Application::create_break_window(BreakId break_id, workrave::utils::Flags<BreakH
|
||||
{
|
||||
IBreakWindow::Ptr break_window = toolkit->create_break_window(i, break_id, break_flags);
|
||||
|
||||
- break_windows.push_back(break_window);
|
||||
- break_window->init();
|
||||
+ if (break_window)
|
||||
+ {
|
||||
+ break_windows.push_back(break_window);
|
||||
+ break_window->init();
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/ui/app/toolkits/gtkmm/IToolkitPrivate.hh b/ui/app/toolkits/gtkmm/IToolkitPrivate.hh
|
||||
index abe3e5dbd..15f966514 100644
|
||||
--- a/ui/app/toolkits/gtkmm/IToolkitPrivate.hh
|
||||
+++ b/ui/app/toolkits/gtkmm/IToolkitPrivate.hh
|
||||
@@ -19,6 +19,7 @@
|
||||
#define ITOOLKIT_PRIVATE_HH
|
||||
|
||||
#include <gtkmm.h>
|
||||
+#include <optional>
|
||||
|
||||
#include "HeadInfo.hh"
|
||||
|
||||
@@ -27,7 +28,7 @@ class IToolkitPrivate
|
||||
public:
|
||||
virtual ~IToolkitPrivate() = default;
|
||||
|
||||
- virtual HeadInfo get_head_info(int screen_index) const = 0;
|
||||
+ virtual std::optional<HeadInfo> get_head_info(int screen_index) const = 0;
|
||||
virtual void attach_menu(Gtk::Menu *menu) = 0;
|
||||
};
|
||||
|
||||
diff --git a/ui/app/toolkits/gtkmm/MainWindow.cc b/ui/app/toolkits/gtkmm/MainWindow.cc
|
||||
index 74af375b9..96a176664 100644
|
||||
--- a/ui/app/toolkits/gtkmm/MainWindow.cc
|
||||
+++ b/ui/app/toolkits/gtkmm/MainWindow.cc
|
||||
@@ -351,7 +351,12 @@ MainWindow::convert_display_to_monitor(int &x, int &y)
|
||||
|
||||
for (int i = 0; i < app->get_toolkit()->get_head_count(); i++)
|
||||
{
|
||||
- HeadInfo head = toolkit_priv->get_head_info(i);
|
||||
+ auto optional_head = toolkit_priv->get_head_info(i);
|
||||
+ if (!optional_head)
|
||||
+ {
|
||||
+ continue;
|
||||
+ }
|
||||
+ HeadInfo head = *optional_head;
|
||||
|
||||
int left = head.get_x();
|
||||
int top = head.get_y();
|
||||
@@ -383,7 +388,12 @@ void
|
||||
MainWindow::convert_monitor_to_display(int &x, int &y, int head)
|
||||
{
|
||||
auto toolkit_priv = std::dynamic_pointer_cast<IToolkitPrivate>(app->get_toolkit());
|
||||
- HeadInfo h = toolkit_priv->get_head_info(head);
|
||||
+ auto optional_head = toolkit_priv->get_head_info(head);
|
||||
+ if (!optional_head)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ HeadInfo h = *optional_head;
|
||||
|
||||
if (x < 0)
|
||||
{
|
||||
diff --git a/ui/app/toolkits/gtkmm/Toolkit.cc b/ui/app/toolkits/gtkmm/Toolkit.cc
|
||||
index 76c456780..8fccf86b6 100644
|
||||
--- a/ui/app/toolkits/gtkmm/Toolkit.cc
|
||||
+++ b/ui/app/toolkits/gtkmm/Toolkit.cc
|
||||
@@ -145,11 +145,22 @@ Toolkit::run()
|
||||
gapp->run();
|
||||
}
|
||||
|
||||
-HeadInfo
|
||||
+std::optional<HeadInfo>
|
||||
Toolkit::get_head_info(int screen_index) const
|
||||
{
|
||||
Glib::RefPtr<Gdk::Display> display = Gdk::Display::get_default();
|
||||
+ if (!display)
|
||||
+ {
|
||||
+ logger->error("Failed to get default display");
|
||||
+ return {};
|
||||
+ }
|
||||
+
|
||||
Glib::RefPtr<Gdk::Monitor> monitor = display->get_monitor(screen_index);
|
||||
+ if (!monitor)
|
||||
+ {
|
||||
+ logger->error("Failed to get monitor for screen index {}", screen_index);
|
||||
+ return {};
|
||||
+ }
|
||||
|
||||
HeadInfo head;
|
||||
head.primary = monitor->is_primary();
|
||||
@@ -178,7 +189,13 @@ Toolkit::create_break_window(int screen_index, BreakId break_id, BreakFlags brea
|
||||
{
|
||||
IBreakWindow::Ptr ret;
|
||||
|
||||
- HeadInfo head = get_head_info(screen_index);
|
||||
+ auto optional_head = get_head_info(screen_index);
|
||||
+ if (!optional_head)
|
||||
+ {
|
||||
+ logger->error("Failed to retrieve monitor info for screen index {}", screen_index);
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ HeadInfo head = *optional_head;
|
||||
|
||||
BlockMode block_mode = GUIConfig::block_mode()();
|
||||
|
||||
@@ -201,7 +218,13 @@ Toolkit::create_break_window(int screen_index, BreakId break_id, BreakFlags brea
|
||||
IPreludeWindow::Ptr
|
||||
Toolkit::create_prelude_window(int screen_index, workrave::BreakId break_id)
|
||||
{
|
||||
- HeadInfo head = get_head_info(screen_index);
|
||||
+ auto optional_head = get_head_info(screen_index);
|
||||
+ if (!optional_head)
|
||||
+ {
|
||||
+ logger->error("Failed to retrieve monitor info for screen index {}", screen_index);
|
||||
+ return nullptr;
|
||||
+ }
|
||||
+ HeadInfo head = *optional_head;
|
||||
return std::make_shared<PreludeWindow>(head, break_id);
|
||||
}
|
||||
|
||||
diff --git a/ui/app/toolkits/gtkmm/Toolkit.hh b/ui/app/toolkits/gtkmm/Toolkit.hh
|
||||
index 159a7815d..d337cd563 100644
|
||||
--- a/ui/app/toolkits/gtkmm/Toolkit.hh
|
||||
+++ b/ui/app/toolkits/gtkmm/Toolkit.hh
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
void init(std::shared_ptr<IApplicationContext> app) override;
|
||||
void deinit() override;
|
||||
|
||||
- HeadInfo get_head_info(int screen_index) const override;
|
||||
+ std::optional<HeadInfo> get_head_info(int screen_index) const override;
|
||||
int get_head_count() const override;
|
||||
|
||||
void terminate() override;
|
||||
diff --git a/ui/app/toolkits/qt/IToolkitPrivate.hh b/ui/app/toolkits/qt/IToolkitPrivate.hh
|
||||
index ac1d16974..06b5c03e5 100644
|
||||
--- a/ui/app/toolkits/qt/IToolkitPrivate.hh
|
||||
+++ b/ui/app/toolkits/qt/IToolkitPrivate.hh
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
|
||||
virtual auto get_desktop_image() -> QPixmap = 0;
|
||||
|
||||
- // virtual HeadInfo get_head_info(int screen_index) const = 0;
|
||||
+ // virtual std::optional<HeadInfo> get_head_info(int screen_index) const = 0;
|
||||
// virtual void attach_menu(Gtk::Menu *menu) = 0;
|
||||
};
|
||||
|
||||
22
710.patch
22
710.patch
|
|
@ -1,22 +0,0 @@
|
|||
From 7bcdae9a7d5b2dd11decdb3adf23736622b5aab8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?=C5=81ukasz=20Wojni=C5=82owicz?=
|
||||
<lukasz.wojnilowicz@gmail.com>
|
||||
Date: Sat, 25 Jul 2026 20:51:49 +0200
|
||||
Subject: [PATCH] Fix appstream id case
|
||||
|
||||
---
|
||||
ui/app/workrave.metainfo.xml | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/ui/app/workrave.metainfo.xml b/ui/app/workrave.metainfo.xml
|
||||
index 794541993..866aaa332 100644
|
||||
--- a/ui/app/workrave.metainfo.xml
|
||||
+++ b/ui/app/workrave.metainfo.xml
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
- <id>org.workrave.workrave</id>
|
||||
+ <id>org.workrave.Workrave</id>
|
||||
<name>Workrave</name>
|
||||
<summary>Workrave assists in the recovery and prevention of Repetitive Strain Injury (RSI)</summary>
|
||||
<metadata_license>CC-BY-3.0</metadata_license>
|
||||
2
sources
2
sources
|
|
@ -1 +1 @@
|
|||
SHA512 (workrave-v1_11_1.tar.gz) = 45b7e7f84cd5d29945006da524676486c1b87627f6d1ff6e9106e9dd0f4034c26052f23649f312cc1513b17470197b4acea4974744d2a8e1093b31523290f82f
|
||||
SHA512 (workrave-v1_11_0_rc_1.tar.gz) = 6538996af3abbbccad3d5b10e88edd1665961d4c5ff393878d2bbc54b78e986676965ed625e1abbfeaf6b8745ef15794679f429f31d3ddce202e0f105c25cbc4
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
%bcond gnome %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond gnome40 %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond gnome45 %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
# Disabled due to missing dependencies.
|
||||
%bcond cinnamon %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond gnome_flashback %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond mate %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond xfce %[0%{?fedora} || 0%{?rhel} <= 9]
|
||||
%bcond gnome 1
|
||||
%bcond gnome40 1
|
||||
%bcond gnome45 %[0%{?fedora} || 0%{?rhel} >= 10]
|
||||
%bcond gnome_flashback %{undefined flatpak}
|
||||
%bcond mate %{undefined flatpak}
|
||||
%bcond xfce %{undefined flatpak}
|
||||
|
||||
%global app_id org.workrave.Workrave
|
||||
|
||||
Name: workrave
|
||||
Version: 1.11.1
|
||||
Version: 1.11.0~rc.1
|
||||
Release: %autorelease
|
||||
Summary: Program that assists in the recovery and prevention of RSI
|
||||
# Based on older packages by Dag Wieers <dag@wieers.com> and Steve Ratcliffe
|
||||
|
|
@ -22,8 +20,10 @@ License: GPL-3.0-or-later AND GPL-2.0-or-later AND LGPL-2.1-or-later AND H
|
|||
URL: https://workrave.org/
|
||||
%global tag %(echo %{version} | sed -e 's/[\\.~]/_/g')
|
||||
Source: https://github.com/rcaelers/workrave/archive/v%{tag}/%{name}-v%{tag}.tar.gz
|
||||
Patch: https://github.com/rcaelers/workrave/pull/710.patch
|
||||
|
||||
# Fixes nullptr dereference
|
||||
# https://github.com/rcaelers/workrave/issues/606
|
||||
Patch: https://github.com/rcaelers/workrave/commit/1be2073.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: gettext
|
||||
|
|
@ -191,6 +191,9 @@ rm -f %{buildroot}%{_libdir}/*.so
|
|||
# indicators need to be enabled to build GIR but are not needed otherwise
|
||||
rm -f %{buildroot}%{_libdir}/*indicators3/7/libworkrave.so*
|
||||
|
||||
# fix appstream ID
|
||||
appstream-util modify %{buildroot}%{_metainfodir}/%{app_id}.metainfo.xml id %{app_id}
|
||||
|
||||
# remove zero-length to silence rpmlint
|
||||
rm -f %{buildroot}%{_datadir}/gnome-shell/extensions/workrave@workrave.org/stylesheet.css
|
||||
|
||||
|
|
@ -199,16 +202,6 @@ rm -f %{buildroot}%{_datadir}/gnome-shell/extensions/workrave@workrave.org/style
|
|||
ln -sf %{_datadir}/workrave/images/workrave-icon-medium.png %{buildroot}%{_datadir}/icons/hicolor/24x24/apps/workrave.png
|
||||
%fdupes %{buildroot}%{_datadir}
|
||||
|
||||
%if %{without cinnamon}
|
||||
# avoid Installed (but unpackaged) file(s) found:
|
||||
rm -rf %{buildroot}%{_datadir}/cinnamon
|
||||
%endif
|
||||
|
||||
%if %{without gnome}
|
||||
# avoid Installed (but unpackaged) file(s) found:
|
||||
rm -rf %{buildroot}%{_datadir}/gnome-shell
|
||||
%endif
|
||||
|
||||
%check
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/%{app_id}.desktop
|
||||
desktop-file-validate %{buildroot}%{_sysconfdir}/xdg/autostart/%{app_id}.desktop
|
||||
|
|
@ -235,11 +228,8 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{app_id}.meta
|
|||
%{_sysconfdir}/xdg/autostart/%{app_id}.desktop
|
||||
%{_metainfodir}/%{app_id}.metainfo.xml
|
||||
|
||||
%if %{with cinnamon}
|
||||
%files cinnamon
|
||||
%{_datadir}/cinnamon/applets/workrave@workrave.org/
|
||||
%else
|
||||
%endif
|
||||
|
||||
%if %{with gnome}
|
||||
%files gnome
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue