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

AltTab shortcuts stop working after hiding a window from AltTab #916

Closed
alt-tab-macos-bot opened this issue Apr 14, 2021 · 6 comments
Closed
Labels
bug Something isn't working

Comments

@alt-tab-macos-bot
Copy link

This issue was opened by a bot after a user submitted feedback through the in-app form.

Message:

Unable to show a window again.

Steps to reproduce:

  • Click on the desktop
  • Click on the window
  • Invoke AltTab
  • Put the focus on the window
  • Hide the window
  • Try to show the window

It seems that all non-global shortcuts become non-working.

@lwouis
Copy link
Owner

lwouis commented Apr 15, 2021

I couldn't understand the steps. How was the window hidden? Through AltTab or through macOS built-in app-hiding functionality? You can't hide a window; only a whole app (= all its windows).

@lwouis lwouis closed this as completed Apr 15, 2021
@lwouis lwouis added unactionable Further action is not possible due to lack of information or support unclear Need help from the author to provide more information to flesh out the issue unreproducible Need help from the author to reproduce the issue labels Apr 15, 2021
@decodism
Copy link
Contributor

I sent this feedback.

Clarification: the last three steps are done in one go in AltTab. By "put the focus on", I just meant "select". Hiding is done with the keyboard shortcut.

I hope you can reproduce it now. (I'm on Big Sur.)

@decodism
Copy link
Contributor

I found a dirty fix: add App.shared.activate(ignoringOtherApps: true) in the "applicationHiddenOrShown" function.

@lwouis lwouis added bug Something isn't working and removed unactionable Further action is not possible due to lack of information or support unclear Need help from the author to provide more information to flesh out the issue unreproducible Need help from the author to reproduce the issue labels Apr 17, 2021
@lwouis
Copy link
Owner

lwouis commented Apr 17, 2021

Thank you for the clarifications @decodism! I was able to reproduce the issue!

I think it can be summed up as such: you can't hide then show an app, if after you hide it, the new active app has no visible window.

Your use-case is with the Finder app, but I could reproduce with any app.

  • Finder open, no window. Chrome open, 1 window -> If I hide/show the Chrome window, it fails at showing
  • Finder open, 1 window. Chrome open, 1 window -> If I hide/show the Chrome window, it works fine

Also interesting to note, if you close AltTab UI and reopens it, then there is no issue. Also, when the issue happens and the shortcut to show the window does nothing, you can't close AltTab UI with the normal alt-escape shortcut.

Looking at logs, it seems that the show order is not sent in that scenario for some reason.

@lwouis
Copy link
Owner

lwouis commented Apr 17, 2021

Ok I think the issue is that AltTab somehow loses keyboard focus in that scenario. Thus the Show shortcut or the close UI shortcut not working.

@lwouis
Copy link
Owner

lwouis commented Apr 17, 2021

This was a logic bug in the applicationActivated function. I wrote a fix.

Very interestingly, testing the fix, I found that in a particular scenario, if I spam the hide/show shortcut and the tab shortcut at the same time, I eventually get the app in a bad state. It repeats the tab shortcut without me holding it. It also ignores local shortcuts. This issue could be related to #719

It's hard to reproduce as you have to spam keys quite a lot. I captured the issue on video, but in that particular reproduction, the tab key doesn't repeat on its own. It's only local shortcuts that stop working at the end of the video

Update: I captured the tab key repeating (in addition to the local shortcuts not working) in this video.

@lwouis lwouis reopened this Apr 17, 2021
@lwouis lwouis changed the title [In-app feedback] AltTab shortcuts stop working after hiding a window from AltTab Apr 17, 2021
@lwouis lwouis closed this as completed in 6be72f3 Apr 17, 2021
lwouis pushed a commit that referenced this issue Apr 17, 2021
# [6.21.0](v6.20.0...v6.21.0) (2021-04-17)

### Bug Fixes

* apps could steal key focus from alt-tab main window ([#719](#719) [#916](#916)) ([6be72f3](6be72f3))

### Features

* update korean location ([c1fc40d](c1fc40d))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants