lwouis / alt-tab-macos

Windows alt-tab on macOS
https://alt-tab-macos.netlify.app
GNU General Public License v3.0
10.55k stars 321 forks source link

Deminimizing windows sometimes leads to a window flicker #3561

Closed lawand closed 3 weeks ago

lawand commented 3 weeks ago

Describe the bug

When a window is minimized, selecting it with alttab to unminimze sometimes leads to the window showing up then hiding then the unminimize animation plays. This doesn't happen when unminimizing with the Dock so it's probably not a macOS bug.

Screenshots / video

https://github.com/user-attachments/assets/1f836bab-2fa4-41fc-9398-2bf50a4cd5cb

This recording shows trying to minimize and unminimze the calculator app many times. Some times using alttab and sometimes using the dock. I noticed that the bug happens only when finder is first focused (by clicking on the desktop). I tried focusing the finder then unminimizing the calculator using the Dock and the bug didn't happen.

Steps to reproduce the bug

  1. Open the calculator app
  2. minimizing it using the yellow button
  3. Focus the finder app by clicking on the desktop
  4. unminimize the calculator using alttab

Your environment

lwouis commented 3 weeks ago

The flicker happens at around 0:19, correct?

I wasn't able to reproduce on my system. I suspect it's a macOS bug. It could also be an issue with the way AltTab focuses windows.

I'm afraid there is nothing we can do though. We use a pretty intricate implementation to focus today. It uses private API/SPIs. There is no known better way to do it, so are a bit stuck with it. It works 99.99% of cases. There have been a few limitations.

More info here

Thank you 🙇

lawand commented 3 days ago

Does this mean that it's possible to fix this issue for windows that are on the same space by making a different API call than the one for windows on other spaces? If so, do you think it's worth it to check which space the window is on then deciding which API to call? I think this would fix this bug since the visual flicker either won't happen or won't be quick enough to be seen for windows on other spaces, so this issue effectively is only for windows on the same space if I understand correctly. I would appreciate your opinion. Thanks