Skip to content

feat: add right-click activation for tiling system with Wayland support#509

Open
tho-maj wants to merge 2 commits intodomferr:mainfrom
tho-maj:feat/right-click-activation
Open

feat: add right-click activation for tiling system with Wayland support#509
tho-maj wants to merge 2 commits intodomferr:mainfrom
tho-maj:feat/right-click-activation

Conversation

@tho-maj
Copy link
Copy Markdown

@tho-maj tho-maj commented Feb 14, 2026

Overview

This PR adds the option to activate the tiling layout by holding the Right Mouse Button while dragging a window. This has been integrated as a new option in the "Activation Key" settings.

Implementation Details & Wayland Support

Implementing this for Wayland was challenging due to Mutter's grab behavior. This PR includes a robust solution for the following issues:

  1. Immediate Grab Termination: On Wayland, clicking RMB while holding LMB (dragging) causes the window manager to instantly terminate the official grab-op.
  2. Manual Tracking Strategy: To keep the tiling interaction fluid, I implemented a "manual tracking" mode (_isRMBInterrupted). When the official grab is interrupted, the window now continues to follow the cursor manually using stored offsets until the Left Mouse Button is released.
  3. State Latching: Introduced _isManualSnap to ensure the tiling logic correctly finalizes the snap even after the official grab state has ended.
  4. Button Mapping: Added support for both BUTTON2_MASK and BUTTON3_MASK to account for environment-specific mapping variations during window moves.
  5. Geometry Correction: Ensured windows are explicitly unmaximized and moved with user_op: true during the final snap to guarantee the correctly adopt the tile dimensions.

Testing

  • Tested on GNOME 47/48 (Wayland).
  • Verified that hover colors reset correctly when leaving the grid.
  • Verified that windows can still be moved partially off-screen during the manual tracking phase.

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.

1 participant