[gtk+/wip/attach-params: 14/20] gtkwindow: use gtk_menu_popup_with_params ()



commit f1c6c74bf272dfaa06fcacf9148df0d2cfd1ecde
Author: William Hua <william hua canonical com>
Date:   Wed Feb 3 10:20:30 2016 -0500

    gtkwindow: use gtk_menu_popup_with_params ()
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756579

 gtk/gtkwindow.c |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index d86f74f..f9c42f0 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -8796,15 +8796,6 @@ popup_menu_detach (GtkWidget *widget,
 }
 
 static void
-popup_position_func (GtkMenu   *menu,
-                     gint      *x,
-                     gint      *y,
-                     gboolean  *push_in,
-                     gpointer   user_data)
-{
-}
-
-static void
 close_window_clicked (GtkMenuItem *menuitem,
                       gpointer     user_data)
 {
@@ -8840,16 +8831,15 @@ gtk_window_do_popup_fallback (GtkWindow      *window,
                     G_CALLBACK (close_window_clicked), window);
   gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);
 
-  if (event)
-    gtk_menu_popup (GTK_MENU (priv->popup_menu),
-                    NULL, NULL,
-                    NULL, NULL,
-                    event->button, event->time);
-  else
-    gtk_menu_popup (GTK_MENU (priv->popup_menu),
-                    NULL, NULL,
-                    popup_position_func, window,
-                    0, gtk_get_current_event_time ());
+  gtk_menu_popup_with_params (GTK_MENU (priv->popup_menu),
+                              NULL,
+                              NULL,
+                              NULL,
+                              event ? event->button : 0,
+                              event ? event->time : gtk_get_current_event_time (),
+                              TRUE,
+                              GDK_WINDOW_TYPE_HINT_POPUP_MENU,
+                              NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]