New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Non-arrow cursors are offset from the hotspot in Wayland #1706
Comments
Successfully reproduced on Weston. We seem to be passing along sane hotspot coordinates, though. |
It seems to me like the hotspot remains unchanged, but the bitmap (the cursor image) is offset. Is there a way to verify that? |
Based on some careful cursor wiggling, it seemed that at least in Weston like the reported cursor position didn't change when we changed to a different cursor, but the compositor treated all cursors as if their hotspots were 0,0 regardless of what we were passing in. I need to read a bit more to be sure GLFW is not doing something wrong. |
I have been in contact with the wayland mailing list and based on their suggestion, I have reasons to believe the problem is somewhere within the GLFW codebase. There is a program in weston called clickdot which traces the cursor position. A weston developer suggested that I try to modify the program to use an alternative cursor, and sure enough, the problem is not reproducible there. Original message from the developer:
This seems to be the case for us
I will try to dig some more to see if I can find the root cause, but at least we know we should focus on GLFW. |
One more interesting response from the weston developer:
which suggests some order-of-operation problem. However, I tried swapping the order:
with no success. |
The wayland protocol spec https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer States that `set_cursor` must be called with the serial number of the `enter` event. However, GLFW is passing in the serial number of the latest received event, which does not meet the protocol spec. As a result, `set_cursor` calls were simply ignored by the compositor. This fix complies with the protocol more closely by specifically caching the `enter` event serial, and using it for all `set_cursor` calls. Fixes glfw#1706
The wayland protocol spec https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer States that `set_cursor` must be called with the serial number of the `enter` event. However, GLFW is passing in the serial number of the latest received event, which does not meet the protocol spec. As a result, `set_cursor` calls were simply ignored by the compositor. This fix complies with the protocol more closely by specifically caching the `enter` event serial, and using it for all `set_cursor` calls. Fixes glfw#1706
@elmindreda FYI I found the problem and put the fix up at #1899 |
The Wayland protocol spec[1] states that set_cursor must be called with the serial number of the enter event. However, GLFW is passing in the serial number of the latest received event, which does not meet the protocol spec. [1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer As a result, set_cursor calls were simply ignored by the compositor. This fix complies with the protocol more closely by specifically caching the enter event serial, and using it for all set_cursor calls. Fixes #1706 Closes #1899 (cherry picked from commit e7758c5)
The Wayland protocol spec[1] states that set_cursor must be called with the serial number of the enter event. However, GLFW is passing in the serial number of the latest received event, which does not meet the protocol spec. [1] https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_pointer As a result, set_cursor calls were simply ignored by the compositor. This fix complies with the protocol more closely by specifically caching the enter event serial, and using it for all set_cursor calls. Fixes glfw#1706 Closes glfw#1899 (cherry picked from commit e7758c5)
Not sure if there is a bug already filed on this, but it is a bit hard to notice.
OS and version: Ubuntu 20.04 or 18.04 running "Ubuntu on Wayland" desktop environment
Release or commit: libglfw3-wayland/focal,now 3.3.2-1 amd64
Error messages: There are no error messages or unusual events, but the minimal app mentioned below can easily show the problem.
Basically, when switching from standard arrow to I-beam, the I-beam does not seem to be aligned with the arrow's hotspot. The app allows changing the cursor shapes using the number keys.
Steps to Reproduce
libglfw3
Expected behaviour
The I-beam's hotspot should align with the arrow's tip
Actual behaviour
The I-beam is offset from the arrow's tip. This seems to happen with other shapes as well. This does NOT happen in X11, so it seems to be a Wayland issue.
The text was updated successfully, but these errors were encountered: