mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
pointer-constraints: fix deactivating oneshot constraint on destroy
This commit is contained in:
parent
9ab87167b5
commit
e3596abc9a
2 changed files with 8 additions and 1 deletions
|
|
@ -39,10 +39,15 @@ static void resource_destroy(struct wl_client *client,
|
|||
}
|
||||
|
||||
static void pointer_constraint_destroy(struct wlr_pointer_constraint_v1 *constraint) {
|
||||
if (constraint == NULL) {
|
||||
if (constraint == NULL || constraint->destroying) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Calling wlr_pointer_constraint_v1_send_deactivated() for a oneshot constraint
|
||||
// that is being destroyed results in another pointer_constraint_destroy() call.
|
||||
// Avoid finalizing the state twice by setting a flag.
|
||||
constraint->destroying = true;
|
||||
|
||||
wlr_log(WLR_DEBUG, "destroying constraint %p", constraint);
|
||||
|
||||
wl_signal_emit_mutable(&constraint->events.destroy, constraint);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue