Skip to content

feat(window): live resize neighboring tiled windows during mouse drag#512

Open
AbdulMateenzwl wants to merge 1 commit intoforge-ext:mainfrom
AbdulMateenzwl:main
Open

feat(window): live resize neighboring tiled windows during mouse drag#512
AbdulMateenzwl wants to merge 1 commit intoforge-ext:mainfrom
AbdulMateenzwl:main

Conversation

@AbdulMateenzwl
Copy link

Previously, neighboring tiled windows would only update their position and size after the mouse button was released, causing a jarring snap effect at the end of every resize operation.

On Wayland, Mutter suppresses size-changed and position-changed signals during active grab operations, so the existing _handleResizing logic never fired during the drag. Additionally, this.move() exits early when metaWindow.grabbed is true, blocking any neighbor repositioning.

Fix by introducing a GLib.timeout_add polling loop (~60fps) that starts on grab-op-begin for resize grabs and stops on grab-op-end:

  • Each tick calls _handleResizing to recalculate sibling percentages
  • initRect is updated per-tick so deltas are frame-relative, preventing percent accumulation across ticks
  • Neighbors are moved via move_resize_frame directly, bypassing the grabbed guard in this.move()
  • A lastWidth/lastHeight guard skips processing when the window size has not changed, also preventing double-processing on X11 where signals still fire during grabs
  • Only the affected container subtree is reprocessed via processNode, not the entire tree

Tested on Wayland (GNOME 49) and confirmed working on X11.

Closes #511

Previously, neighboring tiled windows would only update their position
and size after the mouse button was released, causing a jarring snap
effect at the end of every resize operation.

On Wayland, Mutter suppresses size-changed and position-changed signals
during active grab operations, so the existing _handleResizing logic
never fired during the drag. Additionally, this.move() exits early when
metaWindow.grabbed is true, blocking any neighbor repositioning.

Fix by introducing a GLib.timeout_add polling loop (~60fps) that starts
on grab-op-begin for resize grabs and stops on grab-op-end:

- Each tick calls _handleResizing to recalculate sibling percentages
- initRect is updated per-tick so deltas are frame-relative, preventing
  percent accumulation across ticks
- Neighbors are moved via move_resize_frame directly, bypassing the
  grabbed guard in this.move()
- A lastWidth/lastHeight guard skips processing when the window size has
  not changed, also preventing double-processing on X11 where signals
  still fire during grabs
- Only the affected container subtree is reprocessed via processNode,
  not the entire tree

Tested on Wayland (GNOME 49) and confirmed working on X11.

Closes forge-ext#511
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.

Feat: live resize - neighboring tiled windows resize in real time during mouse drag

1 participant