Fmstrat / wintile

Windows 10 window tiling for GNOME
GNU General Public License v3.0
424 stars 54 forks source link

Focus change while rearranging causes unexpected behaviour #172

Open moritztim opened 11 months ago

moritztim commented 11 months ago

Problem:

Whenever I am restoring my session with a window session manager I have to manually arrange some windows, which I do using wintile. However, as soon as more windows start to launch, chaos ensues. The other windows take the focus and suddenly I'm manipulating them instead of the one I had.

Solution:

I think it would be most intuitive to just note which window is being manipulated and ignore any focus changes until I let go of the modifier key. Then a new window could be chosen based on focus.

PS. I absolutely love this extension

GrylledCheez commented 11 months ago

I'm not sure I understand your solution. Would you mind giving an in-depth example?

moritztim commented 11 months ago

Say I have a window that I want on another screen. I press the modifier key and an arrow a bunch of times to get it to the other screen. I am interrupted by another window opening up and taking focus. Suddenly I am no longer moving the original window but the one that's now in focus. My solution is as follows: Don't tie the window that's being moved to always be the one in focus. This could be achieved by noting which window is currently being manipulated. If another window takes focus, it shouldn't automatically become the one that's being manipulated. So as long as I am pressing the modifier key, the window that wintile is moving stays the same. Even if it's not in focus anymore

moritztim commented 11 months ago

Here: First I move around firefox, then discord loads and takes focus. Suddenly I'm moving discord instead of firefox. https://imgur.com/a/9OXrjbk

GrylledCheez commented 11 months ago

Hmm... I think I can come up with something. That's a good idea.

GrylledCheez commented 11 months ago

@Fmstrat, I'm thinking we can have a null global variable for the focus window that gets populated once by requestMove if it's empty, then have a timer that will loop if SUPER is still held, then it renulls it when it's released.

What do you think?

GrylledCheez commented 11 months ago

Still waiting on @Fmstrat to give his input.

Fmstrat commented 10 months ago

@Fmstrat, I'm thinking we can have a null global variable for the focus window that gets populated once by requestMove if it's empty, then have a timer that will loop if SUPER is still held, then it renulls it when it's released.

What do you think?

I think this sounds great.

@moritz-t-w If it's helpful, I have made a script that uses xdotool and allows me to configure startup apps by monitor index and location (2x2 grid) like so:

    APPS=(
        'Element          | 3 | topRight    | element-desktop'
        'Google Voice     | 3 | bottomRight | /opt/google/chrome/chrome --app-id=bhacinadenbkojblbakackhneiahcgkb'
        'Evolution        | 1 | centered    | evolution'
    )

It opens the apps if they're not already, or moves them if they are. I could probably make it a gist if you want it.

moritztim commented 10 months ago

I could probably make it a gist if you want it. @Fmstrat That sounds nice, I'd quite like a gist