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:
authorCampbell Barton <campbell@blender.org>2022-06-15 08:44:16 +0300
committerCampbell Barton <campbell@blender.org>2022-06-15 08:45:50 +0300
commit4acbb84efaf874717e5d29ad456880ce70ab929c (patch)
treef247818b08feceeb40938879e0410bd5045cd7b0
parent2770010224aabd2fa858e8beba94eb07357e9d3c (diff)
GHOST/Wayland: resolve glitch drawing the software cursor
When grab was disabled, the software cursor would remain displayed in the image view. Ensure an additional redraw is done to clear the cursor.
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index c2a63c9db7a..63a7fb5ddaa 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -1153,9 +1153,17 @@ static bool wm_draw_update_test_window(Main *bmain, bContext *C, wmWindow *win)
if (wm_software_cursor_needed()) {
struct GrabState grab_state;
- if (wm_software_cursor_needed_for_window(win, &grab_state) &&
- wm_software_cursor_motion_test(win)) {
- return true;
+ if (wm_software_cursor_needed_for_window(win, &grab_state)) {
+ if (wm_software_cursor_motion_test(win)) {
+ return true;
+ }
+ }
+ else {
+ /* Detect the edge case when the previous draw used the software cursor but this one doesn't,
+ * it's important to redraw otherwise the software cursor will remain displayed. */
+ if (g_software_cursor.winid != -1) {
+ return true;
+ }
}
}