[nautilus] Revert "use gtk_menu_popup_at_pointer"



commit cff57aa144881de5ff59fb7be26f81a61b2d63da
Author: Alexandru Pandelea <alexandru pandelea gmail com>
Date:   Thu Mar 9 12:34:15 2017 +0200

    Revert "use gtk_menu_popup_at_pointer"
    
    This reverts commit eff346505bb6dd9654fa6bb8c0e92a3642d0b5db.

 src/nautilus-dnd.c    |    4 ++--
 src/nautilus-window.c |   21 +++++++++++++++++++--
 2 files changed, 21 insertions(+), 4 deletions(-)
---
diff --git a/src/nautilus-dnd.c b/src/nautilus-dnd.c
index 4b1d016..733811e 100644
--- a/src/nautilus-dnd.c
+++ b/src/nautilus-dnd.c
@@ -889,8 +889,8 @@ nautilus_drag_drop_action_ask (GtkWidget     *widget,
 
     gtk_grab_add (menu);
 
-    gtk_menu_popup_at_pointer (GTK_MENU (menu),
-                               NULL);
+    gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
+                    NULL, NULL, 0, GDK_CURRENT_TIME);
 
     g_main_loop_run (damd.loop);
 
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 99bd9d5..2fb2a9c 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -1838,6 +1838,7 @@ notebook_popup_menu_show (NautilusWindow *window,
 {
     GtkWidget *popup;
     GtkWidget *item;
+    int button, event_time;
     gboolean can_move_left, can_move_right;
     NautilusNotebook *notebook;
 
@@ -1885,8 +1886,24 @@ notebook_popup_menu_show (NautilusWindow *window,
 
     gtk_widget_show_all (popup);
 
-    gtk_menu_popup_at_pointer (GTK_MENU (popup),
-                               (GdkEvent*) event);
+    if (event)
+    {
+        button = event->button;
+        event_time = event->time;
+    }
+    else
+    {
+        button = 0;
+        event_time = gtk_get_current_event_time ();
+    }
+
+    /* TODO is this correct? */
+    gtk_menu_attach_to_widget (GTK_MENU (popup),
+                               window->priv->notebook,
+                               NULL);
+
+    gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
+                    button, event_time);
 }
 
 /* emitted when the user clicks the "close" button of tabs */


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