Skip to content

cube: rotate with absolute pointing devices - #3176

Merged
ammen99 merged 1 commit into
WayfireWM:masterfrom
italopaesano:fix/cube-absolute-pointer
Oct 24, 2026
Merged

ammen99 merged 1 commit into
WayfireWM:masterfrom
italopaesano:fix/cube-absolute-pointer

Conversation

@italopaesano

Copy link
Copy Markdown
Contributor

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_motion from pointer_interaction_t and turns successive positions into deltas. The cube already derives from that interface and already implements handle_pointer_button and handle_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_motion layout coordinates it has already converted.

pointer_moved() becomes rotate_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_motion is not reached for relative devices: the raw handler zeroes the deltas before wlr_cursor_move sees them, so the cursor does not move and send_motion does not fire. Resetting last_pointer_position in 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.

@ammen99 ammen99 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ammen99

ammen99 commented Oct 24, 2026

Copy link
Copy Markdown
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
italopaesano force-pushed the fix/cube-absolute-pointer branch from 5c2ec79 to 33ff7e6 Compare October 24, 2026 12:19
@ammen99
ammen99 merged commit e91ba81 into WayfireWM:master Oct 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cube: does not rotate when dragging with an absolute pointing device

2 participants