forge icon indicating copy to clipboard operation
forge copied to clipboard

feat: remember last focused window so that when I'm moving my mouse between windows while opening a new window, the window ends up properly autotiled with the last window that was focused instead

Open alexispurslane opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. It is somewhat frustrating to me when I have a vertically split screen layout with two windows, and I want to open a third split with one of the existing windows, horizontally, but my mouse happens to be between the windows or have been in a popup and the focus hasn't updated yet, so when I open the new window, it ends up in a triple vertical split with the other two in this unusable three column layout, instead of horizontally split as expected.

Intended:

|       | |      |        |       |  |       |
|       | |      |    ->  |       |  +-------+
|       | |      |        |       |  |       |

What usually happens:

|       | |      |        |    |  |    | |    |
|       | |      |    ->  |    |  |    | |    |
|       | |      |        |    |  |    | |    |

Describe the solution you'd like Just make a variable that stores the last focused window whenever the variable that stores the currently focused window changes. Then use that variable instead of the current focus variable if no window is currently focused.

alexispurslane avatar May 28 '23 12:05 alexispurslane

Hi @alexispurslane - do you have screencast of the issue?

jmmaranan avatar May 29 '23 17:05 jmmaranan

Hi @alexispurslane - does the PR #252 resolve your issue?

jmmaranan avatar Jul 02 '23 12:07 jmmaranan

Hi @alexispurslane - does the PR #252 resolve your issue?

Not quite, although it could easily be modified to. To resolve my issue, when a new window is opened it would have to check if a window is currently focused and if so, split with that window as usual, while if not, get the window that was last in focus (via the last cursor position perhaps) and split the new window with that window.

alexispurslane avatar Jul 02 '23 12:07 alexispurslane

Ok - would you be able to share your screen/monitor setup/resolution? And also if you do not mind providing a screen recording of the issue ?

jmmaranan avatar Jul 02 '23 12:07 jmmaranan

  • This isn't Quarter tilling?
  • Or maybe Binary tilling?

juarezr avatar Jul 04 '23 00:07 juarezr