[gnome-control-center] user-accounts: Use gtk_menu_popup_at_widget for user photo popup



commit 9536dcdd63728c56a9af874e6e9342d9172a302b
Author: Felipe Borges <felipeborges gnome org>
Date:   Fri Mar 24 12:18:11 2017 +0100

    user-accounts: Use gtk_menu_popup_at_widget for user photo popup
    
    gtk_menu_popup has been deprecated since version 3.22.
    
    The use of gtk_menu_popup lately was causing gtk+ to have to guess
    the right position to present the widget, causing the menu to
    eventually appear in a wrong position under Wayland.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780498

 panels/user-accounts/um-photo-dialog.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/panels/user-accounts/um-photo-dialog.c b/panels/user-accounts/um-photo-dialog.c
index 7feed25..de70b92 100644
--- a/panels/user-accounts/um-photo-dialog.c
+++ b/panels/user-accounts/um-photo-dialog.c
@@ -496,10 +496,11 @@ static void
 popup_icon_menu (GtkToggleButton *button, UmPhotoDialog *um)
 {
         if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (button)) && !gtk_widget_get_visible 
(um->photo_popup)) {
-                gtk_menu_popup (GTK_MENU (um->photo_popup),
-                                NULL, NULL,
-                                (GtkMenuPositionFunc) popup_menu_below_button, um->popup_button,
-                                0, gtk_get_current_event_time ());
+                gtk_menu_popup_at_widget (GTK_MENU (um->photo_popup),
+                                          GTK_WIDGET (button),
+                                          GDK_GRAVITY_NORTH_WEST,
+                                          GDK_GRAVITY_SOUTH_WEST,
+                                          NULL);
         } else {
                 gtk_menu_popdown (GTK_MENU (um->photo_popup));
         }


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