[gnome-disk-utility] gduwindow: Attach popup menu to the window



commit 9cf88e6e1a0cb8f2c9abeccda6579ea5cbc5eae0
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Mon May 2 11:24:04 2016 +0200

    gduwindow: Attach popup menu to the window
    
    For Wayland surfaces to be placed, they need to be subsurfaces, thus
    requiring a parent surface.
    
    Attach the generic menu to the corresponding toplevel widget so that the
    popup menu can be placed where expected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765448

 src/disks/gduwindow.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index 816c9bb..5539788 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -1344,6 +1344,11 @@ gdu_window_constructed (GObject *object)
   gtk_widget_grab_focus (window->device_tree_treeview);
   update_all (window);
 
+  /* attach the generic menu to the toplevel window for correct placement */
+  gtk_menu_attach_to_widget (GTK_MENU (window->generic_menu),
+                             GTK_WIDGET (window),
+                             NULL);
+
   /* TODO: would be better to have all this in the .ui file - no idea
    * why it doesn't work - accelerator support in GTK+ seems extremely
    * confusing and flaky :-(


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