public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: raveit65 <raveit65.sun@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/mate-notification-daemon] rawhide: add upstream patch to fix crash when monitor change during notification
Date: Thu, 25 Jun 2026 16:48:46 GMT [thread overview]
Message-ID: <178240612621.1.3958503532062910286.rpms-mate-notification-daemon-edbe10ce658c@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/mate-notification-daemon
Branch : rawhide
Commit : edbe10ce658cdb8bcb0f4e2113e1e3b66c15beef
Author : raveit65 <raveit65.sun@gmail.com>
Date : 2026-06-25T18:44:41+02:00
Stats : +71/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/mate-notification-daemon/c/edbe10ce658cdb8bcb0f4e2113e1e3b66c15beef?branch=rawhide
Log:
add upstream patch to fix crash when monitor change during notification
---
diff --git a/mate-notification-daemon.spec b/mate-notification-daemon.spec
index 6586950..99f9818 100644
--- a/mate-notification-daemon.spec
+++ b/mate-notification-daemon.spec
@@ -9,6 +9,9 @@ License: GPL-2.0-or-later
URL: http://mate-desktop.org
Source0: http://pub.mate-desktop.org/releases/%{branch}/%{name}-%{version}.tar.xz
+# https://github.com/mate-desktop/mate-notification-daemon/pull/258
+Patch1: mate-notification-daemon_0001-daemon-fix-crash-when-monitor-changes-during-notific.patch
+
BuildRequires: desktop-file-utils
BuildRequires: gtk-layer-shell-devel
BuildRequires: libcanberra-devel
diff --git a/mate-notification-daemon_0001-daemon-fix-crash-when-monitor-changes-during-notific.patch b/mate-notification-daemon_0001-daemon-fix-crash-when-monitor-changes-during-notific.patch
new file mode 100644
index 0000000..59396ea
--- /dev/null
+++ b/mate-notification-daemon_0001-daemon-fix-crash-when-monitor-changes-during-notific.patch
@@ -0,0 +1,68 @@
+From 2ea0233c2a547e062206b2e1d3cc6ad067eba85c Mon Sep 17 00:00:00 2001
+From: Joakim Tjernlund <joakim.tjernlund@nokia.com>
+Date: Fri, 10 Oct 2025 14:36:08 +0000
+Subject: [PATCH] daemon: fix crash when monitor changes during notification
+
+When monitors change during network events, suspend/resume, or hotplug,
+the daemon could use an invalid monitor index to look up the
+notification stack, causing a segfault.
+
+Validate the monitor index before use, and pass it directly when
+creating stacks instead of re-querying.
+
+Fixes #257
+---
+ src/daemon/daemon.c | 19 ++++++-------------
+ 1 file changed, 6 insertions(+), 13 deletions(-)
+
+diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
+index 473a598..4ff9ea9 100644
+--- a/src/daemon/daemon.c
++++ b/src/daemon/daemon.c
+@@ -367,11 +367,11 @@ _gtk_get_monitor_num (GdkMonitor *monitor)
+ return -1;
+ }
+
+-static void create_stack_for_monitor(NotifyDaemon* daemon, GdkScreen* screen, GdkMonitor *monitor_num)
++static void create_stack_for_monitor(NotifyDaemon* daemon, GdkScreen* screen, GdkMonitor *monitor_num, int num)
+ {
+ NotifyScreen* nscreen = daemon->screen;
+
+- nscreen->stacks[_gtk_get_monitor_num(monitor_num)] = notify_stack_new(daemon, screen, monitor_num, daemon->stack_location);
++ nscreen->stacks[num] = notify_stack_new(daemon, screen, monitor_num, daemon->stack_location);
+ }
+
+ static void on_screen_monitors_changed(GdkScreen* screen, NotifyDaemon* daemon)
+@@ -461,7 +461,7 @@ static void create_stacks_for_screen(NotifyDaemon* daemon, GdkScreen *screen)
+
+ for (i = 0; i < nscreen->n_stacks; i++)
+ {
+- create_stack_for_monitor(daemon, screen, gdk_display_get_monitor (display, i));
++ create_stack_for_monitor(daemon, screen, gdk_display_get_monitor (display, i), i);
+ }
+ }
+
+@@ -1840,17 +1840,10 @@ static gboolean notify_daemon_notify_handler(NotifyDaemonNotifications *object,
+ monitor_id = gdk_display_get_monitor (gdk_display_get_default(), (int) daemon->screen->n_stacks - 1);
+ }
+
+- if (monitor_id != NULL && _gtk_get_monitor_num (monitor_id) >= daemon->screen->n_stacks)
++ int mon_num = monitor_id != NULL ? _gtk_get_monitor_num (monitor_id) : -1;
++ if (mon_num >= 0 && mon_num < (int) daemon->screen->n_stacks)
+ {
+- /* screw it - dump it on the last one we'll get
+- a monitors-changed signal soon enough*/
+- monitor_id = gdk_display_get_monitor (gdk_display_get_default(), (int) daemon->screen->n_stacks - 1);
+- }
+-
+- /* If we still don't have a valid monitor, something is seriously wrong */
+- if (monitor_id != NULL && daemon->screen->n_stacks > 0)
+- {
+- notify_stack_add_window (daemon->screen->stacks[_gtk_get_monitor_num (monitor_id)], nw, new_notification);
++ notify_stack_add_window (daemon->screen->stacks[mon_num], nw, new_notification);
+ }
+ }
+
+--
+2.54.0
+
reply other threads:[~2026-06-25 16:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178240612621.1.3958503532062910286.rpms-mate-notification-daemon-edbe10ce658c@fedoraproject.org \
--to=raveit65.sun@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox