domferr / tilingshell

Extend Gnome Shell with advanced tiling window management. Supports multiple monitors, Windows 11 Snap Assistant, Fancy Zones, customised tiling layouts and more.
https://extensions.gnome.org/extension/7065/tiling-shell/
GNU General Public License v2.0
478 stars 7 forks source link

Extend edge tiling detection to panel areas #108

Closed PJungkamp closed 1 month ago

PJungkamp commented 1 month ago

Describe the bug

The Tiling Shell does not detect tiling regions for drags outside the workArea of a monitor, e.g. drags in the area occupied by any shell panel.

To Reproduce (Mouse movement too fast)

  1. Flick a window over the top-center edge tiling area of the screen to maximize it, so that the mouse stops on the top panel.

This does not function as intended if the mouse moves too fast, where the EdgeTilingManager's startEdgeTiling function is never called for the _topCenter rectangle.

To Reproduce (Drag along the panel)

  1. Drag a window over the top-center edge tiling area onto the top panel. (The edge tiling preview shows the maximized window)
  2. Drag the mouse along the panel to the left or right corner. (The edge tiling preview does not update the region)

The EdgeTilingManager treats all panels beyond the working area as changed: false cases. See https://github.com/domferr/tilingshell/blob/c3a24061325dca5d38ddfb1cda8897acb2c269e3/src/components/tilingsystem/edgeTilingManager.ts#L173-L176

Additional Context

I think that the tiling code should calculate the edge-tiling and snap-assist detection using a combination of both the monitors actual geometry (Main.layoutManager.monitors[index]) and the workArea when dragging a window. The TilingManager is already aware of the actual _monitor and uses it's real geometry in _isPointerInsideThisMonitor. But the EdgeTilingManager and SnapAssist don't handle mouse movements on panels properly.

A simple solution might be to clamp the x and y pointer coordinates to the workArea before passing them to the EdgeTilingManager or SnapAssist. Another solution might be to extend the rectangles used for detection (e.g. _topCenter/_topLeft/...) to the actual edges of the monitor instead of the edges of the workArea.

Information (please complete the following):

PJungkamp commented 1 month ago

Here are some videos to demonstrate the issue:

  1. Fast cursor movements onto the panel. Screencast from 2024-07-26 13-57-25.webm

  2. Drag along the panel. Screencast from 2024-07-26 14-03-08.webm

domferr commented 1 month ago

Hey @PJungkamp thank you for sharing this! This is the best issue ever made for Tiling Shell :smile: so far

domferr commented 1 month ago

:heavy_check_mark: Done in version 12.1! The new version is already available on GSE