From 35b2b9b6e6079902d78602afce10e2e3bb9e6b40 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 18 Jun 2022 15:02:18 +1000 Subject: Fix T98793: Wayland clamps cursor movement fails with gnome-shell The current gnome-shell (v42.2) has a bug where grabbing the cursor doesn't scale the region when confining it to the window. For Hi-DPI displays this means the cursor may be confined to a quarter of the window, making grab unusable. Even though this has been fixed up-stream the issue remains in the latest release - so workaround the problem by implementing window confined grab using a software cursor. This is only used gnome-shell for displays that use Hi-DPI scaling. --- intern/ghost/intern/GHOST_Window.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern/ghost/intern/GHOST_Window.h') diff --git a/intern/ghost/intern/GHOST_Window.h b/intern/ghost/intern/GHOST_Window.h index adbc29eb84e..6ca2651fad0 100644 --- a/intern/ghost/intern/GHOST_Window.h +++ b/intern/ghost/intern/GHOST_Window.h @@ -154,7 +154,12 @@ class GHOST_Window : public GHOST_IWindow { void getCursorGrabState(GHOST_TGrabCursorMode &mode, GHOST_TAxisFlag &axis_flag, - GHOST_Rect &bounds); + GHOST_Rect &bounds, + bool &use_software_cursor); + /** + * Return true when a software cursor should be used. + */ + bool getCursorGrabUseSoftwareDisplay(); /** * Sets the progress bar value displayed in the window/application icon -- cgit v1.2.3