Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Rauch <Rauch.Christian@gmx.de>2020-05-13 01:04:50 +0300
committerChristian Rauch <Rauch.Christian@gmx.de>2020-05-13 01:05:24 +0300
commit75e989dab6c7a5bea9b7f7b406513ffd105a14e2 (patch)
treefc5fbcb5fe849592eeddce0af13cdd53d2726fe3 /intern/ghost
parent5b86fe6f33505bcea7c81021506eb538908c245d (diff)
GHOST: fix cursor buffer handling when toggling visibility
Diffstat (limited to 'intern/ghost')
-rw-r--r--intern/ghost/intern/GHOST_SystemWayland.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWayland.cpp b/intern/ghost/intern/GHOST_SystemWayland.cpp
index 1ec63a0a41b..a450805c43c 100644
--- a/intern/ghost/intern/GHOST_SystemWayland.cpp
+++ b/intern/ghost/intern/GHOST_SystemWayland.cpp
@@ -167,6 +167,9 @@ static void display_destroy(display_t *d)
munmap(input->cursor.file_buffer->data, input->cursor.file_buffer->size);
delete input->cursor.file_buffer;
}
+ if (input->cursor.buffer) {
+ wl_buffer_destroy(input->cursor.buffer);
+ }
if (input->cursor.surface) {
wl_surface_destroy(input->cursor.surface);
}
@@ -1612,15 +1615,18 @@ GHOST_TSuccess GHOST_SystemWayland::setCursorVisibility(bool visible)
return GHOST_kFailure;
}
- cursor_t *cursor = &d->inputs[0]->cursor;
+ input_t *input = d->inputs[0];
+
+ cursor_t *cursor = &input->cursor;
if (visible) {
if (!cursor->visible) {
- set_cursor_buffer(d->inputs[0], d->inputs[0]->cursor.buffer);
+ set_cursor_buffer(input, cursor->buffer);
}
}
else {
if (cursor->visible) {
- set_cursor_buffer(d->inputs[0], nullptr);
+ set_cursor_buffer(input, nullptr);
+ cursor->buffer = nullptr;
}
}