mirror of
https://github.com/labwc/labwc.git
synced 2026-03-16 05:33:50 -04:00
interactive: Fix crash if a window is destroyed while moving it
Need to clean this up if it's our grabbed window! Signed-off-by: Joshua Ashton <joshua@froggi.es>
This commit is contained in:
parent
a9f11c5fc7
commit
3e973c92ab
4 changed files with 10 additions and 0 deletions
|
|
@ -452,6 +452,7 @@ void seat_set_focus_layer(struct seat *seat, struct wlr_layer_surface_v1 *layer)
|
||||||
|
|
||||||
void interactive_begin(struct view *view, enum input_mode mode,
|
void interactive_begin(struct view *view, enum input_mode mode,
|
||||||
uint32_t edges);
|
uint32_t edges);
|
||||||
|
void interactive_end(struct view *view);
|
||||||
|
|
||||||
void output_init(struct server *server);
|
void output_init(struct server *server);
|
||||||
void output_damage_surface(struct output *output, struct wlr_surface *surface,
|
void output_damage_surface(struct output *output, struct wlr_surface *surface,
|
||||||
|
|
|
||||||
|
|
@ -38,3 +38,10 @@ interactive_begin(struct view *view, enum input_mode mode, uint32_t edges)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void interactive_end(struct view *view) {
|
||||||
|
if (view->server->grabbed_view == view) {
|
||||||
|
view->server->input_mode = LAB_INPUT_STATE_PASSTHROUGH;
|
||||||
|
view->server->grabbed_view = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,7 @@ handle_destroy(struct wl_listener *listener, void *data)
|
||||||
if (view->toplevel_handle) {
|
if (view->toplevel_handle) {
|
||||||
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
|
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
|
||||||
}
|
}
|
||||||
|
interactive_end(view);
|
||||||
wl_list_remove(&view->link);
|
wl_list_remove(&view->link);
|
||||||
ssd_destroy(view);
|
ssd_destroy(view);
|
||||||
free(view);
|
free(view);
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,7 @@ handle_destroy(struct wl_listener *listener, void *data)
|
||||||
if (view->toplevel_handle) {
|
if (view->toplevel_handle) {
|
||||||
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
|
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
|
||||||
}
|
}
|
||||||
|
interactive_end(view);
|
||||||
view->xwayland_surface = NULL;
|
view->xwayland_surface = NULL;
|
||||||
wl_list_remove(&view->link);
|
wl_list_remove(&view->link);
|
||||||
wl_list_remove(&view->map.link);
|
wl_list_remove(&view->map.link);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue