summaryrefslogtreecommitdiff
path: root/src/themes/standard
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-03-21 12:06:06 -0400
committerLuke from DC <[email protected]>2026-04-02 19:19:35 +0000
commita7ba9a1701eddd9c9e55a4a88b0ea136440cc539 (patch)
tree1a04194521f05817a857be89d20d7bd4ac3bd044 /src/themes/standard
parent3e9622c956004afc33df2768dc0db66327fe534d (diff)
downloadmate-notification-daemon-master.tar.bz2
mate-notification-daemon-master.tar.xz
daemon: Fix NotificationClosed signal reason for close buttonHEADmaster
When clicking the close button on a notification, the D-Bus signal incorrectly sent reason=1 (expired) instead of reason=2 (dismissed). Fixed by setting a flag on the notification window in the close button callback before destroying it, and checking this flag in the callback to send the correct close reason. Fixes #129
Diffstat (limited to 'src/themes/standard')
-rw-r--r--src/themes/standard/theme.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/themes/standard/theme.c b/src/themes/standard/theme.c
index 90171c6..b670f5b 100644
--- a/src/themes/standard/theme.c
+++ b/src/themes/standard/theme.c
@@ -642,6 +642,13 @@ static gboolean activate_link(GtkLabel* label, const char* url, WindowData* wind
return TRUE;
}
+static void
+close_button_clicked_cb(GtkButton* button, GtkWidget* win)
+{
+ g_object_set_data(G_OBJECT(win), "_user_closed", GINT_TO_POINTER(1));
+ gtk_widget_destroy(win);
+}
+
GtkWindow* create_notification(UrlClickedCb url_clicked)
{
GtkWidget* spacer;
@@ -754,7 +761,7 @@ GtkWindow* create_notification(UrlClickedCb url_clicked)
gtk_button_set_relief(GTK_BUTTON(close_button), GTK_RELIEF_NONE);
gtk_container_set_border_width(GTK_CONTAINER(close_button), 0);
//gtk_widget_set_size_request(close_button, 20, 20);
- g_signal_connect_swapped(G_OBJECT(close_button), "clicked", G_CALLBACK(gtk_widget_destroy), win);
+ g_signal_connect(G_OBJECT(close_button), "clicked", G_CALLBACK(close_button_clicked_cb), win);
atkobj = gtk_widget_get_accessible(close_button);
atk_action_set_description(ATK_ACTION(atkobj), 0,