Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus change while rearranging causes unexpected behaviour #172

Open
moritztim opened this issue Sep 12, 2023 · 8 comments
Open

Focus change while rearranging causes unexpected behaviour #172

moritztim opened this issue Sep 12, 2023 · 8 comments
Assignees

Comments

@moritztim
Copy link

moritztim commented Sep 12, 2023

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
Copy link
Collaborator

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

@moritztim
Copy link
Author

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
Copy link
Author

moritztim commented Sep 12, 2023

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
Copy link
Collaborator

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

@GrylledCheez GrylledCheez self-assigned this Sep 12, 2023
@GrylledCheez
Copy link
Collaborator

@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
Copy link
Collaborator

Still waiting on @Fmstrat to give his input.

@Fmstrat
Copy link
Owner

Fmstrat commented Oct 11, 2023

@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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants