Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c99908cf384c4b39b49eec744d35f86c6e681227
https://github.com/WebKit/WebKit/commit/c99908cf384c4b39b49eec744d35f86c6e681227
Author: Roope Salmi <[email protected]>
Date: 2024-07-23 (Tue, 23 Jul 2024)
Changed paths:
M Source/WebKit/UIProcess/gtk/PointerLockManagerX11.cpp
M Source/WebKit/UIProcess/gtk/PointerLockManagerX11.h
Log Message:
-----------
[GTK][X11] Improve pointer lock
https://bugs.webkit.org/show_bug.cgi?id=276659
Reviewed by Carlos Garcia Campos.
My previous attempt in 280623@main had an issue where if the mouse was
moving while pointer lock was started, the movementX/Y values would be
offset because m_initialPoint and m_x11RootInitialPoint disagreed.
I now switched to using XWarpPointer in the relative mode (src_w and
dst_w are None). The relative warp is easier to calculate than the
absolute one as GTK3 and GTK4 use different coordinates for
m_initialPoint.
An added benefit is that subpixel offsets and movement that happened
after the event are preserved. The feel is better, but it's still
possible for a delta to be "double counted" if a new event happens
before the warp is processed.
It seems like some other implementations warp the pointer to the center of
the window, so there is space for the pointer to move even if started
at the edge of the window. I didn't attempt that now.
Tested on GTK3 & GTK4 at various DPI scales.
* Source/WebKit/UIProcess/gtk/PointerLockManagerX11.cpp:
(WebKit::PointerLockManagerX11::lock):
(WebKit::PointerLockManagerX11::didReceiveMotionEvent):
* Source/WebKit/UIProcess/gtk/PointerLockManagerX11.h:
Canonical link: https://commits.webkit.org/281232@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes