diff options
author | RAR27 <[email protected]> | 2023-06-02 20:19:25 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2023-06-02 20:19:25 -0400 |
commit | 6a6cf2841c4bb83f45015067d5bd503be1ab0188 (patch) | |
tree | e3e6f22804dcd2fbda4d136fa52ab833bd93b782 /sway/tree/root.c | |
parent | 15bf6ae835f43a4b2cc870dafc525735dfedc54a (diff) |
fix: crash when moving tabbed container to scratchpad (#182)
when `scratchpad_minimize` enabled
Diffstat (limited to 'sway/tree/root.c')
-rw-r--r-- | sway/tree/root.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sway/tree/root.c b/sway/tree/root.c index 636a3b75..2c1b96b8 100644 --- a/sway/tree/root.c +++ b/sway/tree/root.c @@ -57,12 +57,15 @@ void root_destroy(struct sway_root *root) { /* Set minimized state from scratchpad container `show` state */ static void root_scratchpad_set_minimize(struct sway_container *con, bool minimize) { - struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel = con->view->foreign_toplevel; - if (wlr_surface_is_xwayland_surface(con->view->surface)) { - struct wlr_xwayland_surface *xsurface = wlr_xwayland_surface_from_wlr_surface(con->view->surface); - wlr_xwayland_surface_set_minimized(xsurface, minimize); - } else if (foreign_toplevel) { - wlr_foreign_toplevel_handle_v1_set_minimized(foreign_toplevel, minimize); + if (con->view) { + struct wlr_foreign_toplevel_handle_v1 *foreign_toplevel = con->view->foreign_toplevel; + + if (wlr_surface_is_xwayland_surface(con->view->surface)) { + struct wlr_xwayland_surface *xsurface = wlr_xwayland_surface_from_wlr_surface(con->view->surface); + wlr_xwayland_surface_set_minimized(xsurface, minimize); + } else if (foreign_toplevel) { + wlr_foreign_toplevel_handle_v1_set_minimized(foreign_toplevel, minimize); + } } } |