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

Window focus is lost when using Show Desktop #788

Open
SweaterFish opened this issue Nov 12, 2024 · 3 comments
Open

Window focus is lost when using Show Desktop #788

SweaterFish opened this issue Nov 12, 2024 · 3 comments
Assignees

Comments

@SweaterFish
Copy link

Pressing "Show Desktop" once minimizes windows to reveal the desktop. Pressing "Show Desktop" a second time restores windows, but on v3.6.0 it does not restore the window focus, requiring some additional input from the user before we can interact with the restored windows. This is true whether the "Show Desktop" taskbar button is used, or the KeySysShowDesktop shortcut, or even icesh desktop 1|0.

I tried booting a system snapshot with IceWM 3.4.1 and there "Show Desktop" worked as I expected/remembered, restoring the windows and focus when pressed a second time. I then updated only IceWM on that snapshot to 3.6.0 and the behavior of "Show Desktop" changed to what I described above. Window focus is not restored when pressing Show Desktop a second time even though the windows themselves are.

I think this means the issue is not caused by any other app or by a setting in my user preferences file, though possibly there is a new preference that I need to change?

@SweaterFish
Copy link
Author

Testing this more, it seems to only happen if you have an application occupying the desktop layer, such as a desktop icon manager or a terminal window set as the Dekstop layer. I guess this is because that application takes the focus when switching to Show Desktop, but doesn't give back the focus when "Unshowing" the desktop.

Again, though, this was not the behavior in IceWM 3.4.1 and earlier. Even when using an app as the desktop. Pressing Show Desktop a second time returned the focus to the previously focused window.

@gijsbers
Copy link
Collaborator

I'll look into it later. Thanks for reporting this.
In the mean time, can you use the doNotFocus winoption?
Did you think of that solution? Why not?

@gijsbers gijsbers self-assigned this Nov 14, 2024
@SweaterFish
Copy link
Author

I just tried setting doNotFocus for my desktop layer app (urxvt) and that does allow a second press of Show Desktop to return focus to the previously focused window. But of course it also means the app on the desktop layer doesn't focus after the first press of Show Desktop, so there's no way to interact with it.

You may have already made this connection, but in case not, I see this in the changelog for v3.4.6

When undoing an arrange or showing the desktop, focus the last focused window instead of the topmost window.

So that's almost certainly the cause of this. I had never noticed before, but I do confirm that the behavior in 3.4.1 is to focus the topmost window after undoing Show Desktop, not actually the previously focused window if it wasn't on top. In 3.6.0 it really is the previously focused window as long as there's not a desktop layer app that grabs the focus first.

If there's no simple way to return focus to the last focused window even when a desktop layer app has grabbed focus inbetween, maybe there could be preference to switch between the old way and the new way.

gijsbers added a commit that referenced this issue Nov 28, 2024
…t focused window instead of the topmost window." for issue #788.

This reverts commit 2abbe86.
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

2 participants