[gimp] libgimpwidgets: Set transient_for on scrolledpreview



commit e8b6ba5c10fccea907118a961c4a9b61c2428bc8
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Wed Dec 30 10:24:48 2020 +0100

    libgimpwidgets: Set transient_for on scrolledpreview
    
    This makes sure that the navigation popup actually shows up on certain
    window managers (like those based on Wayland).

 libgimpwidgets/gimpscrolledpreview.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/libgimpwidgets/gimpscrolledpreview.c b/libgimpwidgets/gimpscrolledpreview.c
index d35b93b482..38b37823f5 100644
--- a/libgimpwidgets/gimpscrolledpreview.c
+++ b/libgimpwidgets/gimpscrolledpreview.c
@@ -537,6 +537,7 @@ gimp_scrolled_preview_nav_button_press (GtkWidget           *widget,
   if (event->type == GDK_BUTTON_PRESS && event->button == 1)
     {
       GtkStyleContext *context = gtk_widget_get_style_context (widget);
+      GtkWidget       *toplevel;
       GtkWidget       *outer;
       GtkWidget       *inner;
       GtkWidget       *area;
@@ -550,6 +551,13 @@ gimp_scrolled_preview_nav_button_press (GtkWidget           *widget,
 
       priv->nav_popup = gtk_window_new (GTK_WINDOW_POPUP);
 
+      toplevel = gtk_widget_get_toplevel (GTK_WIDGET (preview));
+      if (GTK_IS_WINDOW (toplevel))
+        {
+          gtk_window_set_transient_for (GTK_WINDOW (priv->nav_popup),
+                                        GTK_WINDOW (toplevel));
+        }
+
       gtk_window_set_screen (GTK_WINDOW (priv->nav_popup),
                              gtk_widget_get_screen (widget));
 


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