summaryrefslogtreecommitdiff
path: root/src/themes/standard
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2026-03-21 12:06:06 -0400
committerVictor Kareh <[email protected]>2026-03-22 17:34:10 -0400
commit24562cc76211579c9169039dab5d337a4731cf6e (patch)
tree3e5a85959b33093c71d2ba888515e63aea2b1343 /src/themes/standard
parent3f72f66032c6f9b80fc22e15a2fb33804d000bc6 (diff)
downloadmate-notification-daemon-fix-close-reason.tar.bz2
mate-notification-daemon-fix-close-reason.tar.xz
daemon: Fix NotificationClosed signal reason for close buttonfix-close-reason
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,