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
625 stars 18 forks source link

Untile Hotkey Fails After Tiling, Untiling, and Re-Tiling Window #180

Open SuiziM opened 1 week ago

SuiziM commented 1 week ago

After using hotkeys to move or span a window across tiles and then un-tiling it, the "Untile focused window" hotkey fails to work after re-tiling.

To Reproduce

  1. Use hotkey to move a window to a specific tile or span it across tiles.
  2. Use the hotkey to "Untile focused window."
  3. Use a tiling hotkey from step 1 again.
  4. Try to use the "Untile focused window" hotkey—notice that it no longer works.

Screenrecording

Screenrecording

Super + Left = Move window to left tile Super + Delete = Untile focused window

Information

Tiling Shell version: 14.1
GNOME version: 47.1

Thanks for all the great work on Tiling Shell!

domferr commented 6 days ago

Hey @SuiziM thank you for reporting this issue! I made some tests and I can reproduce the problem. I made a bugfix, let me know if it works and if it doesn't create other problems :smile:

tilingshell@ferrarodomenico.com.zip

SuiziM commented 6 days ago

Thanks for the quick turnaround! This mostly addresses the issue; I’ve only noticed two edge cases, which might be harder to reproduce. One might not even be related to this.

First Issue

Occurs when positioning the window too close to a screen border, then tiling, untiling, and attempting to tile in the direction of the near screen border.

Steps To Reproduce

  1. Position the window near a screen border.
  2. Tile the window using hotkeys.
  3. Untile the window using hotkeys.
  4. Attempt to tile the window toward the near screen border—notice that this fails.

Tiling in other directions still works.

Screenrecording Issue1

The recording first shows that retiling after untiling works correctly toward distant screen borders, but then demonstrates the failure when tiling toward a very close screen border.

Second Issue

Occurs when positioning the window so it overlaps two tiles, while keeping the center in one tile (e.g., the left). Tiling toward the other tile (e.g., right) does not work as expected.

Steps to Reproduce

  1. Position the window with the mouse so it overlaps two tiles, but keep its center within one (e.g., the left tile).
  2. Try tiling the window to the opposite tile using hotkeys.
  3. Notice that the window tiles to the tile where its center is located instead.

After using hotkeys to untile, tiling works as expected.

Screenrecording Issue2

(I forgot to enable the mouse pointer display in the screen recording.)

SuiziM commented 6 days ago

Sorry, for the "Opening-Closing"-spam. I'm new to Github.

domferr commented 5 days ago

Hey @SuiziM thank you for the feedback. The second issue is how Tiling Shell works. The algorithm in that particular occasion chooses the nearest tile to the center. Did you expect another behavior, such as the nearest tile in the direction of the hotkey? The issue one seems a little bit particular and I'm able to reproduce the problem. I'm working on a fix :smile:

SuiziM commented 1 day ago

Sorry, for taking a while to answer.

Regarding the "second issue": When I use the 'Move tile to right' hotkey in that case, the window moves to the left, which is odd to me.

This becomes even more noticeable in the following screencast: if I shift the window just a few millimeters, the same hotkey produces entirely different behavior.

MoveToRight

I don't think anyone would expect the window to tile to the left in this case.

Possible Improvement: Reference Point Based on Direction Playing around with more "advanced" tiling layouts, trying out the tiling hotkeys and thinking it through, I feel like the reference point should depend on the direction i.e

Maybe with a slight offset towards the center, might involve some trial and error to see what's really intuitive. Reference for points

Inconsistent Behavior Based on "Positioning Method" Even if I'm okay with this behavior, it's still a bit weird that the hotkey behaves differently depending on how the window is positioned:

The behaviour of the "Span window to X / Above /Below" hotkey also gets changed by the "Untile"-hotkey compared to moving it there by mouse.

domferr commented 17 hours ago

Hey thank you for sharing this! I agree with you: Tiling Shell's keybindings behave differently when a window is untiled and this is counter intuitive. IDK why I made this :laughing:

I removed such difference, check it out and let me know how it is now! Thank you

tilingshell@ferrarodomenico.com.zip