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
This commit is contained in:
Rui Matos 2015-02-24 20:55:45 +01:00
parent 59f348eb11
commit 438410c22c
2 changed files with 10 additions and 2 deletions

View File

@ -1161,8 +1161,6 @@ xdg_shell_get_xdg_popup (struct wl_client *client,
parent_surf->window->rect.y + y); parent_surf->window->rect.y + y);
window->showing_for_first_time = FALSE; window->showing_for_first_time = FALSE;
window->placed = TRUE; 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); meta_wayland_surface_set_window (surface, window);

View File

@ -64,6 +64,16 @@ meta_window_wayland_manage (MetaWindow *window)
window->stamp, window->stamp,
0); 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 static void