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