Commit 599ecd97 authored by Tim Clem's avatar Tim Clem Committed by Alexandre Julliard

winemac.drv: Use -setMouseConfinementRect: for cursor clipping by default.

On macOS 10.13+, use this private NSWindow method for ClipCursor calls. The old behavior can be restored by setting the per-app Mac Driver registry key UseConfinementCursorClipping to N. Signed-off-by: 's avatarTim Clem <tclem@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 648fcd18
......@@ -1211,8 +1211,12 @@ static NSString* WineLocalizedString(unsigned int stringID)
- (BOOL) startClippingCursor:(CGRect)rect
{
if (!clipCursorHandler)
clipCursorHandler = [[WineEventTapClipCursorHandler alloc] init];
if (!clipCursorHandler) {
if (use_confinement_cursor_clipping && [WineConfinementClipCursorHandler isAvailable])
clipCursorHandler = [[WineConfinementClipCursorHandler alloc] init];
else
clipCursorHandler = [[WineEventTapClipCursorHandler alloc] init];
}
if (self.clippingCursor && CGRectEqualToRect(rect, clipCursorHandler.cursorClipRect))
return TRUE;
......
......@@ -34,6 +34,10 @@
* -[NSWindow setMouseConfinementRect:]. It comes with its own drawbacks,
* but is generally far simpler. It is described and implemented in
* the WineConfinementClipCursorHandler class.
*
* On macOS 10.13+, WineConfinementClipCursorHandler is the default.
* The Mac driver registry key UseConfinementCursorClipping can be set
* to "n" to use the event tap implementation.
*/
......
......@@ -162,6 +162,7 @@ extern int right_option_is_alt DECLSPEC_HIDDEN;
extern int left_command_is_ctrl DECLSPEC_HIDDEN;
extern int right_command_is_ctrl DECLSPEC_HIDDEN;
extern int allow_immovable_windows DECLSPEC_HIDDEN;
extern int use_confinement_cursor_clipping DECLSPEC_HIDDEN;
extern int cursor_clipping_locks_windows DECLSPEC_HIDDEN;
extern int use_precise_scrolling DECLSPEC_HIDDEN;
extern int gl_surface_mode DECLSPEC_HIDDEN;
......
......@@ -57,6 +57,7 @@ int right_command_is_ctrl = 0;
BOOL allow_software_rendering = FALSE;
BOOL disable_window_decorations = FALSE;
int allow_immovable_windows = TRUE;
int use_confinement_cursor_clipping = TRUE;
int cursor_clipping_locks_windows = TRUE;
int use_precise_scrolling = TRUE;
int gl_surface_mode = GL_SURFACE_IN_FRONT_OPAQUE;
......@@ -194,6 +195,9 @@ static void setup_options(void)
if (!get_config_key(hkey, appkey, "AllowImmovableWindows", buffer, sizeof(buffer)))
allow_immovable_windows = IS_OPTION_TRUE(buffer[0]);
if (!get_config_key(hkey, appkey, "UseConfinementCursorClipping", buffer, sizeof(buffer)))
use_confinement_cursor_clipping = IS_OPTION_TRUE(buffer[0]);
if (!get_config_key(hkey, appkey, "CursorClippingLocksWindows", buffer, sizeof(buffer)))
cursor_clipping_locks_windows = IS_OPTION_TRUE(buffer[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment