Revert "Fix a crash when unlocking or unconfining a pointer"

This reverts commit e0dc5d47cb.

Signed-off-by: Dima Ryazanov <dima@gmail.com>
dev
Dima Ryazanov 6 years ago committed by Daniel Stone
parent 99553750db
commit 336ce67da7
  1. 23
      clients/window.c

@ -286,7 +286,6 @@ struct window {
confined_pointer_unconfined_handler_t pointer_unconfined_handler; confined_pointer_unconfined_handler_t pointer_unconfined_handler;
struct zwp_confined_pointer_v1 *confined_pointer; struct zwp_confined_pointer_v1 *confined_pointer;
struct input *confined_input;
struct widget *confined_widget; struct widget *confined_widget;
bool confined; bool confined;
@ -4793,8 +4792,8 @@ static void
locked_pointer_locked(void *data, locked_pointer_locked(void *data,
struct zwp_locked_pointer_v1 *locked_pointer) struct zwp_locked_pointer_v1 *locked_pointer)
{ {
struct window *window = data; struct input *input = data;
struct input *input = window->locked_input; struct window *window = input->pointer_focus;
window->pointer_locked = true; window->pointer_locked = true;
@ -4809,8 +4808,8 @@ static void
locked_pointer_unlocked(void *data, locked_pointer_unlocked(void *data,
struct zwp_locked_pointer_v1 *locked_pointer) struct zwp_locked_pointer_v1 *locked_pointer)
{ {
struct window *window = data; struct input *input = data;
struct input *input = window->locked_input; struct window *window = input->pointer_focus;
window_unlock_pointer(window); window_unlock_pointer(window);
@ -4865,7 +4864,7 @@ window_lock_pointer(struct window *window, struct input *input)
ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT); ZWP_POINTER_CONSTRAINTS_V1_LIFETIME_ONESHOT);
zwp_locked_pointer_v1_add_listener(locked_pointer, zwp_locked_pointer_v1_add_listener(locked_pointer,
&locked_pointer_listener, &locked_pointer_listener,
window); input);
window->locked_input = input; window->locked_input = input;
window->locked_pointer = locked_pointer; window->locked_pointer = locked_pointer;
@ -4907,8 +4906,8 @@ static void
confined_pointer_confined(void *data, confined_pointer_confined(void *data,
struct zwp_confined_pointer_v1 *confined_pointer) struct zwp_confined_pointer_v1 *confined_pointer)
{ {
struct window *window = data; struct input *input = data;
struct input *input = window->confined_input; struct window *window = input->pointer_focus;
window->confined = true; window->confined = true;
@ -4923,8 +4922,8 @@ static void
confined_pointer_unconfined(void *data, confined_pointer_unconfined(void *data,
struct zwp_confined_pointer_v1 *confined_pointer) struct zwp_confined_pointer_v1 *confined_pointer)
{ {
struct window *window = data; struct input *input = data;
struct input *input = window->confined_input; struct window *window = input->pointer_focus;
window_unconfine_pointer(window); window_unconfine_pointer(window);
@ -4989,9 +4988,8 @@ window_confine_pointer_to_rectangles(struct window *window,
zwp_confined_pointer_v1_add_listener(confined_pointer, zwp_confined_pointer_v1_add_listener(confined_pointer,
&confined_pointer_listener, &confined_pointer_listener,
window); input);
window->confined_input = input;
window->confined_pointer = confined_pointer; window->confined_pointer = confined_pointer;
window->confined_widget = NULL; window->confined_widget = NULL;
@ -5052,7 +5050,6 @@ window_unconfine_pointer(struct window *window)
zwp_confined_pointer_v1_destroy(window->confined_pointer); zwp_confined_pointer_v1_destroy(window->confined_pointer);
window->confined_pointer = NULL; window->confined_pointer = NULL;
window->confined = false; window->confined = false;
window->confined_input = NULL;
} }
static void static void

Loading…
Cancel
Save