do-sch / gnome-shell-touchpad-window-move

GNOME Extension that allows moving windows with three finger trackpad gestures
GNU General Public License v3.0
24 stars 6 forks source link

Window jumping to being centered around cursor when starting to drag maximized window #4

Closed xuiqzy closed 4 years ago

xuiqzy commented 4 years ago

Thanks for making this extension, it mostly works really nicely!

The window jumps to being centered around the cursor when starting to drag a maximized window. It would be better if the window would move relatively according to where the drag started (e.g. upper right part of window), matching the behavior of pressing Super and clicking and moving a window when it is currently maximized. Currently, the behaviors differ and I feel like the integrated Gnome Shell behavior is more useful.

do-sch commented 4 years ago

The Super key like behaviour was removed in an older version of the extension because it caused the following issue:

If the mouse pointer is in a lower corner of the screen and the unmaximized window size is quite small, the mouse pointer will be outside the window. If the user temporary lifts his fingers, he won't be able to keep dragging the window as the pointer won't be on top of it anymore: example

This isn't a great problem when dragging a window with the Super method while using a mouse, because you usually don't release the Super key and the primary button when hovering the mouse.

Unfortunately I couldn't decide where to put the window in such a case so I always centered the window at the pointer.

If you wish, I can do one of the following in case maximized window size is (200, 200) and unmaximized window size is (100, 100) :

  1. Scale the position. When the user starts dragging at position (20, 20) of the maximized window, center the unmaximized window at (10, 10)
  2. Align at nearest border. When starting dragging at (20, 20) also align with (20, 20). When starting dragging at (180, 20) center at (80, 20). When starting dragging at (110, 20) start dragging at (60, 20)
  3. If pointer is outside of the window after unmaximizing, let it only jump so far that the pointer is on top of it.
  4. Let the pointer jump instead of the window