alt-tab-macos icon indicating copy to clipboard operation
alt-tab-macos copied to clipboard

Consecutive Alt-Tab's to bounce between two different apps doesn't always pick the right "previous" app

Open stevehoek opened this issue 8 months ago • 23 comments

A common use of a window switcher is to "bounce" back and forth between two app windows. For instance, going back and forth between Chrome and Outlook.

I haven't figured out the pattern yet, but in the latest version 7.21.1 and possibly the one before it, I often see the current app window selected by default in the Alt-Tab grid UI, so when I release Alt-Tab it simply stays with the same app window.

Other times, it works as it should

I've looked to see if the issue is app windows in different spaces, or full screen app windows such as Microsoft Remote Desktop, but I can't find a pattern

stevehoek avatar Mar 08 '25 01:03 stevehoek

I can't reproduce it. Please share steps to reproduce

Thank you

lwouis avatar Mar 08 '25 07:03 lwouis

Could reproduce the issue with Microsoft Outlook and OneNote.

Also, in case if within the settings I've set the 'Show Hidden Window' and 'Show Minimized Window' to 'Hide', than neither Outlook, neither OneNote appear in the windows list.

So, seem that AltTab can't see that window is open and is focused under some conditions.

  • The issue is reproducible immediately after OS restart, right after the Safari and OneNote start - the screenshot is attached
  • The issue may gone later - after some manipulations with windows, however - can not identify when exactly.

Note, that I have the screen recording switched off.

Image

alshpak avatar Mar 25 '25 18:03 alshpak

Also happening to me in both grid and list UI. Here are my settings if it helps.

Image Image

benlmyers avatar Mar 27 '25 07:03 benlmyers

Hi,

Could someone please share a video of the issue, as well as steps to reproduce?

Thank you 🙇

lwouis avatar Mar 27 '25 20:03 lwouis

https://github.com/user-attachments/assets/3cd2d30e-3d9a-45b5-b2b8-b63da8dce4a1

In this video, every time Alt-tab shows is via keybind. Frustrating issue as I expect pressing Alt-Tab switches windows, but instead it focuses on the current window. Let me get a fresh install of AltTab to see if I can reproduce.

benlmyers avatar Mar 27 '25 22:03 benlmyers

The initial comment of this issue mentioned the problem happening periodically, but for me, it always occurs. Even on a fresh install:

  1. install Alt-tab
  2. press Alt-tab on keyboard
  3. release Alt-tab
  4. window does not switch

macOS 15.3.1 (24D70) Macbook Pro, 16 inch, 2024 AltTab 7.21.1

benlmyers avatar Mar 27 '25 22:03 benlmyers

Hi @benlmyers,

You have set Preferences > Controls > Order Windows by: Recently Created First. This makes the focus order fixed. If you want to quickly move from window A > window B > window A. Then you need to use the default order which is Recently Focused First

What about other people in this thread? Which order have you set?

Thank you 🙇

lwouis avatar Mar 27 '25 23:03 lwouis

@lwouis I have always had it set to the default "Recently Focused First". For me this has never been an issue before the last release or two, for what it is worth.

stevehoek avatar Mar 27 '25 23:03 stevehoek

Using "Recently Focused First" solves it for me. Thank you!

benlmyers avatar Mar 28 '25 06:03 benlmyers

Good news @benlmyers

For the others, we are back to https://github.com/lwouis/alt-tab-macos/issues/4313#issuecomment-2759458668 🙇

lwouis avatar Mar 28 '25 07:03 lwouis

Hi @benlmyers,

You have set Preferences > Controls > Order Windows by: Recently Created First. This makes the focus order fixed. If you want to quickly move from window A > window B > window A. Then you need to use the default order which is Recently Focused First

What about other people in this thread? Which order have you set?

Thank you 🙇

Mine has been set to the default Recently Focused First but I've noticed that chat apps (slack, discord) and macos mail in particular get thrown at the bottom of the order frequently after the screen is unlocked; a restart of Alt-Tab restores the order as expected.

Edit: this is on a 2019 macbook pro 16 running sonoma 14.7.3.

abawany avatar Mar 28 '25 22:03 abawany

Running into the same issue, restart fixes for a while.

I'm using App Icons as my visual setting, and have checked that it is indeed using the "Recently Focused First."

Non-native and older apps seem to trigger this especially often, for what it's worth.

norrbru avatar Mar 31 '25 08:03 norrbru

Just wanted to add that I've also had this issue, and exiting and relaunching AltTab also fixes it for me. I haven't changed my settings since getting this laptop three years ago (always set to "Recently Updated First"), and I've never had the issue until recently, so it does seem to be related to some recent change.

Edit: after seeing the next comment, I realized I did first notice this with Terminal full screen, but the issue persisted even when the app was no longer in full screen so I dismissed that as being related at the time.

agfor avatar Apr 02 '25 19:04 agfor

I've been doing some testing trying to determine which release the bug was introduced in.
I'm fairly certain it was introduced in 7.20.0 This version had alot of changes which imo really improved AltTab's ability to find all windows at startup, but with all those code changes came this bug I believe. I've been running 7.19.1 for a couple days and haven't seen the bug.

I'm curious if any of the others that have this issue have any of these situations present when they do see it:

  • full screen apps (for me I have 3 Microsoft Remote Desktop "Windows App" sessions open full screen, and Plex full screen)
  • iOS apps (for me I have 2 running, downloaded from the Mac App Store's iOS/iPadOS category for Apple Silicon Macs)

Hopefully we can help @lwouis narrow down the repro steps and he can look at the code changes in 7.20.0 to see if he can see anything that could cause it.

stevehoek avatar Apr 02 '25 23:04 stevehoek

I've been doing some testing trying to determine which release the bug was introduced in. I'm fairly certain it was introduced in 7.20.0 This version had alot of changes which imo really improved AltTab's ability to find all windows at startup, but with all those code changes came this bug I believe. I've been running 7.19.1 for a couple days and haven't seen the bug.

I'm curious if any of the others that have this issue have any of these situations present when they do see it:

* full screen apps (for me I have 3 Microsoft Remote Desktop "Windows App" sessions open full screen, and Plex full screen)
* iOS apps (for me I have 2 running, downloaded from the Mac App Store's iOS/iPadOS category for Apple Silicon Macs)

...

The above two aren't true for me (no full-screen apps, unable to run ios apps) and I still see the issue on my 2019 x86 mbp running macos 14.7.3. I've noticed that it happens after the machine has been inactive/asleep for 8+ hours and tends to happen to macos mail and chat apps, none of which run in full-screen mode.

abawany avatar Apr 03 '25 20:04 abawany

I faced the same issue. I'm using v7.20.1 and it works very well.

cedrus-8864 avatar Apr 10 '25 03:04 cedrus-8864

@stevehoek

I'm fairly certain it was introduced in 7.20.0

@cedrus-8864

I'm using v7.20.1 and it works very well

I'm not sure what to make of this 😅

lwouis avatar Apr 10 '25 15:04 lwouis

I've been on 7.19.1 for a week now and haven't seen the issue. Anytime I go back to 7.20.0 or later it happens after an hour or so and you need to restart the app to get it right again.

Several of us have the issue, so there is something there in the code changes for 7.20.0.
Where in the code does the sorted window list get built for display in the the window switcher UI?

stevehoek avatar Apr 12 '25 18:04 stevehoek

Just had this issue (and several times before in the past weeks) when switching between Notes.app and Safari.app on 7.23.0. Restarting Alt-tab helped but seems like it's still an unsolved issue?

jancbeck avatar Apr 23 '25 13:04 jancbeck

Same issue here. For me it happens when switching between random apps - for same apps it works, some apps are not recognized (e.g. Cursor sometimes). Restarting AltTab fixes it for a while but it happens again after some time. I also didn't change the settings since 2 years or so. The issue started happening in recent time and brought me to this github issue.

If I can help you debug, please let me know.

Version 7.23.0

fosple avatar Apr 29 '25 16:04 fosple

@lwouis I recently had to restart for a MacOS update, and now I'm having this problem again (Version 7.23.0). Rather than closing and re-opening AltTab to fix it, is there something I can do to help you track down the source of the problem?

Edit: I'm unable to take a memory dump as I can't disable System Integrity Protection, and AltTab isn't signed with the entitlement to allow debugging. If you add this entitlement and release a new version, I would be happy to take a memory dump if it happens again. I don't know anything about MacOS desktop apps, so I don't actually know if this is doable.

Rough instructions for adding the entitlement are here (this is the error I got trying to use lldb): https://stackoverflow.com/questions/66575538/xcode-lldb-cant-attach-to-macos-system-program-bin-cp-not-allowed-to-attach

agfor avatar May 06 '25 21:05 agfor

Adding this as a separate comment as I think it's a new observation?

The issue just seems to have fixed itself without restarting AltTab. I believe this was caused by switching the affected app between fullscreen and windowed mode. This doesn't work all the time, as I did this yesterday at least once and I'm sure others have tried, and it didn't resolve, but maybe that points towards the issue?

Anyone else able to try this when having the bug, switching the app between fullscreen and windowed several times until it fixes it?

agfor avatar May 09 '25 17:05 agfor

I've been working around the issue by using the following script on the terminal to restart the app:

osascript -e 'quit app "AltTab"'; osascript -e 'launch app "AltTab"';

abawany avatar May 09 '25 22:05 abawany

Same issue. Almost always happens with iTerm.

nvartolomei avatar Jun 25 '25 14:06 nvartolomei

@lwouis any way to collect some debug information maybe?

nvartolomei avatar Jun 25 '25 14:06 nvartolomei

Same issue. Almost always happens with iTerm.

Same for me

Shaked avatar Jul 04 '25 18:07 Shaked

I think this solved it for me. Still testing, however the sporadic behavior displayed in this thread suggests that IF you happened to nudge your mouse/pad even the tiniest bit during the alt-tab operation, you would end up on a different window. By design.

Image

lgrkvst avatar Sep 20 '25 13:09 lgrkvst

Not a pure duplicate since this was reported before v7.28.0. However there is nothing actionable in this ticket. Let's focus the discussion in #4754

lwouis avatar Sep 20 '25 13:09 lwouis