[Xfce4-commits] [apps/xfce4-notifyd] 20/24: panel-plugin: Attach menu to the button

noreply at xfce.org noreply at xfce.org
Fri Sep 8 23:27:51 CEST 2017


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-notifyd.

commit c12e88eedec13eb90eb4b02c822876f99f8ed257
Author: Viktor Odintsev <ninetls at xfce.org>
Date:   Fri Aug 25 02:07:19 2017 +0300

    panel-plugin: Attach menu to the button
---
 panel-plugin/notification-plugin.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/notification-plugin.c b/panel-plugin/notification-plugin.c
index 5a5694f..fba715e 100644
--- a/panel-plugin/notification-plugin.c
+++ b/panel-plugin/notification-plugin.c
@@ -63,15 +63,16 @@ notification_plugin_menu_new (NotificationPlugin *notification_plugin)
 {
   GtkWidget *mi;
   GtkWidget *label;
+  GtkWidget *menu;
 
-  notification_plugin->menu = gtk_menu_new ();
+  menu = gtk_menu_new ();
   /* connect signal on show to update the items */
-  g_signal_connect_swapped (notification_plugin->menu, "show", G_CALLBACK (notification_plugin_menu_populate),
+  g_signal_connect_swapped (menu, "show", G_CALLBACK (notification_plugin_menu_populate),
                             notification_plugin);
 
   /* Show all the items */
-  gtk_widget_show_all (GTK_WIDGET (notification_plugin->menu));
-  return notification_plugin->menu;
+  gtk_widget_show_all (GTK_WIDGET (menu));
+  return menu;
 }
 
 
@@ -166,6 +167,7 @@ notification_plugin_new (XfcePanelPlugin *panel_plugin)
 
   /* create the menu */
   notification_plugin->menu = notification_plugin_menu_new (notification_plugin);
+  gtk_menu_attach_to_widget (GTK_MENU (notification_plugin->menu), notification_plugin->button, NULL);
   gtk_widget_set_name (GTK_WIDGET (notification_plugin->menu), "xfce4-notification-plugin-menu");
 
   g_signal_connect (notification_plugin->button, "button-press-event",

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list