Repository navigation
cube: rotate with absolute pointing devices - #3176
Merged
Merged
Conversation
Member
|
Can you rebase so that we can get the uncrustify CI ? |
The cube only subscribed to wlr_pointer_motion_event, that is, relative motion. Absolute devices -- drawing tablets, touchscreens used as pointers, and the virtual tablets hypervisors expose to guests -- never produce those deltas, so the cube opened but could not be rotated at all. The same applies to nested sessions, since the wlroots X11 backend reports absolute motion only. Implement handle_pointer_motion() from pointer_interaction_t, which the cube already derives from and whose handle_pointer_button() and handle_pointer_axis() it already implements. The core feeds that interface for both kinds of device and passes positions already converted to layout coordinates; successive positions are turned into deltas. The relative path is unchanged, including the delta zeroing that pins the pointer in place. pointer_moved() becomes rotate_cube(double, double) so that both paths share the rotation code. Fixes WayfireWM#3175 Co-Authored-By: Claude <noreply@anthropic.com>
italopaesano
force-pushed
the
fix/cube-absolute-pointer
branch
from
October 24, 2026 12:19
5c2ec79 to
33ff7e6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3175.
The cube subscribed only to
wf::input_event_signal<wlr_pointer_motion_event>, that is, relative motion. Absolute devices never produce those deltas, so while the cube was grabbed the plugin received no motion events at all and the cube could not be rotated.What this does
Implements
handle_pointer_motionfrompointer_interaction_tand turns successive positions into deltas. The cube already derives from that interface and already implementshandle_pointer_buttonandhandle_pointer_axis.Using the interface rather than subscribing to the raw absolute signal follows the guidance given on #2521: the raw input signals are there for the pointer-pinning case, and the normal interfaces elsewhere. It also avoids duplicating coordinate conversion, since the raw absolute event carries normalised 0..1 values while the core hands
handle_pointer_motionlayout coordinates it has already converted.pointer_moved()becomesrotate_cube(double, double)so that both paths share the rotation code. That refactor is the one already proposed in #2521.The relative path is untouched
Including the delta zeroing that pins the pointer in place, added in #938. The same values reach the same arithmetic.
handle_pointer_motionis not reached for relative devices: the raw handler zeroes the deltas beforewlr_cursor_movesees them, so the cursor does not move andsend_motiondoes not fire. Resettinglast_pointer_positionin that handler makes it a no-op even if it were reached, which also covers systems mixing both kinds of device.Verified
Checked in a nested X11 session, where the cube receives no motion events before the change and rotates after it.
For regressions, two builds differing only by this patch were compared on real hardware with a mouse and a touchpad: the workspace-transition threshold is identical down to the input unit — 1 face up to 117 units of motion, 2 faces from 118, in both builds — which bounds any change in rotation speed below 0.7%.
Known limitation
The pointer cannot be pinned for absolute devices, because pinning works by zeroing deltas that those devices do not send. Rotation therefore stops once the pointer reaches the edge of the output. This is inherent to the approach rather than an oversight.