diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 22202b42..b3b2b552 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -2127,6 +2127,10 @@ set_transient(struct shell_surface *shsurf, { assert(parent != NULL); + shell_surface_set_parent(shsurf, parent); + + surface_clear_next_states(shsurf); + shsurf->transient.x = x; shsurf->transient.y = y; shsurf->transient.flags = flags; @@ -2149,9 +2153,6 @@ shell_surface_set_transient(struct wl_client *client, struct weston_surface *parent = wl_resource_get_user_data(parent_resource); - shell_surface_set_parent(shsurf, parent); - - surface_clear_next_states(shsurf); set_transient(shsurf, parent, x, y, flags); } diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 4bce02dd..70c8cf7c 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -2179,6 +2179,7 @@ xserver_map_shell_surface(struct weston_wm *wm, struct weston_shell_interface *shell_interface = &wm->server->compositor->shell_interface; struct weston_output *output; + struct weston_wm_window *parent; if (!shell_interface->create_shell_surface) return; @@ -2208,14 +2209,19 @@ xserver_map_shell_surface(struct weston_wm *wm, shell_interface->set_fullscreen(window->shsurf, WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT, 0, output); - } else if (!window->override_redirect && !window->transient_for) { - shell_interface->set_toplevel(window->shsurf); - return; - } else { + } else if (window->override_redirect) { shell_interface->set_xwayland(window->shsurf, window->x, window->y, WL_SHELL_SURFACE_TRANSIENT_INACTIVE); + } else if (window->transient_for) { + parent = window->transient_for; + shell_interface->set_transient(window->shsurf, + parent->surface, + parent->x - window->x, + parent->y - window->y, 0); + } else { + shell_interface->set_toplevel(window->shsurf); } }