[mutter] window-wayland: Set transient and window type on manage() for popups



commit 438410c22c87889cc43a97d20556af6fab4cb718
Author: Rui Matos <tiagomatos gmail com>
Date:   Tue Feb 24 20:55:45 2015 +0100

    window-wayland: Set transient and window type on manage() for popups
    
    Doing this on manage() allows the common MetaWindow initialization to
    do the right thing for popups like setting skip_taskbar and
    skip_pager.
    
    In particular this avoids gnome-shell's app tracker to create a new
    ShellApp instance for every popup.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745118

 src/wayland/meta-wayland-surface.c |    2 --
 src/wayland/window-wayland.c       |   10 ++++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland-surface.c b/src/wayland/meta-wayland-surface.c
index 69f6102..3a6f6b6 100644
--- a/src/wayland/meta-wayland-surface.c
+++ b/src/wayland/meta-wayland-surface.c
@@ -1161,8 +1161,6 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
                           parent_surf->window->rect.y + y);
   window->showing_for_first_time = FALSE;
   window->placed = TRUE;
-  meta_window_set_transient_for (window, parent_surf->window);
-  meta_window_set_type (window, META_WINDOW_DROPDOWN_MENU);
 
   meta_wayland_surface_set_window (surface, window);
 
diff --git a/src/wayland/window-wayland.c b/src/wayland/window-wayland.c
index 55c24c5..b358a73 100644
--- a/src/wayland/window-wayland.c
+++ b/src/wayland/window-wayland.c
@@ -64,6 +64,16 @@ meta_window_wayland_manage (MetaWindow *window)
                                    window->stamp,
                                    0);
   }
+
+  if (window->surface->role == META_WAYLAND_SURFACE_ROLE_XDG_POPUP)
+    {
+      MetaWaylandSurface *parent = window->surface->popup.parent;
+
+      g_assert (parent);
+
+      meta_window_set_transient_for (window, parent->window);
+      meta_window_set_type (window, META_WINDOW_DROPDOWN_MENU);
+    }
 }
 
 static void


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