[gucharmap] chartable: fix zoom window on Wayland



commit cda5ee26e25042b41a45d34c96113b97512213e8
Author: Olivier Fourdan <ofourdan redhat com>
Date:   Wed Dec 9 09:43:59 2015 +0100

    chartable: fix zoom window on Wayland
    
    On Wayland, popup windows are for menu type widgets and thus the
    protocol requires a device grab, which gucharmap doesn't do.
    
    As a result, the zoom window is dismissed instantly on Wayland.
    
    For the use case here, best would be to use a subsurface for the zoom
    window, which can be obtained by "attaching" the popup to the parent so
    that gtk+ can select the subsurface type for the popup.
    
    Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759229

 gucharmap/gucharmap-chartable.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gucharmap/gucharmap-chartable.c b/gucharmap/gucharmap-chartable.c
index f3b6596..a97f4ec 100644
--- a/gucharmap/gucharmap-chartable.c
+++ b/gucharmap/gucharmap-chartable.c
@@ -782,6 +782,9 @@ make_zoom_window (GucharmapChartable *chartable)
     return;
 
   priv->zoom_window = gtk_window_new (GTK_WINDOW_POPUP);
+  /* For wayland, we need to "attach" the popup to the toplevel */
+  gtk_window_set_transient_for (GTK_WINDOW (priv->zoom_window),
+                                GTK_WINDOW (gtk_widget_get_toplevel (widget)));
   gtk_window_set_resizable (GTK_WINDOW (priv->zoom_window), FALSE);
   gtk_window_set_screen (GTK_WINDOW (priv->zoom_window),
                          gtk_widget_get_screen (widget));


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