aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-10-18 15:04:37 -0400
committerGitHub <noreply@github.com>2017-10-18 15:04:37 -0400
commita41d45eefb754e5b9a167b96728d301546b5e19c (patch)
tree833f60be82249c2d129c0de48cb2433ba99acb78 /backend
parent9129687ad6dcf162b3af8d91b2fc582f185d0943 (diff)
parenta7d7659a930bb73ec34b00c492074fbf812377b2 (diff)
Merge pull request #285 from emersion/fix-wayland-hidden-cursor
Fix hidden cursors
Diffstat (limited to 'backend')
-rw-r--r--backend/wayland/output.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/wayland/output.c b/backend/wayland/output.c
index d308b907..e1138ee1 100644
--- a/backend/wayland/output.c
+++ b/backend/wayland/output.c
@@ -66,10 +66,12 @@ static bool wlr_wl_output_set_cursor(struct wlr_output *_output,
}
if (!buf) {
// Hide cursor
- wl_surface_destroy(output->cursor_surface);
- munmap(output->cursor_data, output->cursor_buf_size);
- output->cursor_surface = NULL;
- output->cursor_buf_size = 0;
+ if (output->cursor_surface) {
+ wl_surface_destroy(output->cursor_surface);
+ munmap(output->cursor_data, output->cursor_buf_size);
+ output->cursor_surface = NULL;
+ output->cursor_buf_size = 0;
+ }
wlr_wl_output_update_cursor(output, output->enter_serial, hotspot_x,
hotspot_y);
return true;