diff gtk3/dw.c @ 2113:aaea278c2356

GTK: Fix variant warning, needed to specify parameter type on action. Implemented notification clicked callback on GTK2.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 22 Jun 2020 04:44:47 +0000
parents b33d020b04e7
children 251d050d306b
line wrap: on
line diff
--- a/gtk3/dw.c	Sun Jun 21 22:04:51 2020 +0000
+++ b/gtk3/dw.c	Mon Jun 22 04:44:47 2020 +0000
@@ -1960,7 +1960,7 @@
 static void _dw_notification_handler(GSimpleAction *action, GVariant *param, gpointer user_data)
 {
    char textbuf[101] = {0};
-   void (*func)(HWND, void *);
+   int (*func)(HWND, void *);
    void *data;
    
    snprintf(textbuf, 100, "dw-notification-%llu-func", (unsigned long long)g_variant_get_uint64(param));
@@ -2069,7 +2069,7 @@
    {
 #if GLIB_CHECK_VERSION(2,40,0)
       /* Creat our notification handler for any notifications */
-      GSimpleAction *action = g_simple_action_new("notification", NULL);
+      GSimpleAction *action = g_simple_action_new("notification", "t");
       
       g_signal_connect(G_OBJECT(action), "activate", G_CALLBACK(_dw_notification_handler), NULL);
       g_action_map_add_action(G_ACTION_MAP(_DWApp), G_ACTION(action));
@@ -11079,8 +11079,6 @@
 
    if(notification)
    {
-      GVariant *param = g_variant_new_uint64((guint64)notification);
-      
       if(description)
       {
          va_list args;
@@ -11094,7 +11092,7 @@
       }
       if(pixmap && pixmap->pixbuf)
          g_notification_set_icon(notification, G_ICON(pixmap->pixbuf));
-      g_notification_set_default_action_and_target_value(notification, "app.notification", param); 
+      g_notification_set_default_action_and_target(notification, "app.notification", "t", (guint64)notification); 
    }
    return (HWND)notification;
 #else