aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authornyorain <nyorain@gmail.com>2017-06-22 18:04:13 +0200
committernyorain <nyorain@gmail.com>2017-06-22 18:04:13 +0200
commit4ca872c91477f272d829b7fe5488eee36472448a (patch)
treecfaa287f2b4ea6bbfff04adb2e52fc05ddf1b14a /backend
parentdbde1f734075d47cdada320f056a4e3f7f528755 (diff)
Improve wayland backend pointer error logging
Diffstat (limited to 'backend')
-rw-r--r--backend/wayland/wl_seat.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/backend/wayland/wl_seat.c b/backend/wayland/wl_seat.c
index aedc4a00..ab3de74d 100644
--- a/backend/wayland/wl_seat.c
+++ b/backend/wayland/wl_seat.c
@@ -30,7 +30,9 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer,
static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,
uint32_t serial, struct wl_surface *surface) {
-
+ struct wlr_input_device *dev = data;
+ assert(dev && dev->pointer && dev->pointer->state);
+ dev->pointer->state->current_output = NULL;
}
static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
@@ -38,7 +40,11 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer,
struct wlr_input_device *dev = data;
assert(dev && dev->pointer && dev->pointer->state);
struct wlr_pointer_state *state = dev->pointer->state;
- assert(state->current_output);
+
+ if(!state->current_output) {
+ wlr_log(L_ERROR, "pointer motion event without current output");
+ return;
+ }
int width, height;
wl_egl_window_get_attached_size(state->current_output->state->egl_window,