From 438410c22c87889cc43a97d20556af6fab4cb718 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Tue, 24 Feb 2015 20:55:45 +0100 Subject: [PATCH] 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 69f610217..3a6f6b616 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 55c24c583..b358a73a1 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