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

Windowless Apps Not Showing in Switcher

Open darthlite opened this issue 10 months ago • 22 comments

Describe the bug

I have "Hide apps with no open window" set to Off. I open an app, close all its windows (but do not quit the app). The app does not show in in the AltTab switcher (I think it did until a few months ago when I first noticed this; I remember I used to quit apps from the switcher all the time by highlighting the app and hitting q).

Screenshots / video

Just to be clear: I have ensured Word has no other windows open on any of the other desktop spaces (other apps do have windows open in other spaces but I have AltTab set to only show apps on current space). I then opened a fresh instance in the new space (one in the video), then closed the window, but not the app.

https://github.com/user-attachments/assets/53ac41db-f714-46bd-9fa4-a8aeae165353

Steps to reproduce the bug

See video above. Nothing special is required (unless I have messed something up or have something special configured - would appreciate the help to figure out what exactly).

Your environment

  • AltTab version: 7.14.1
  • macOS version: 15.1.1 (24B91)
  • Other relevant info: The demo was generated using

darthlite avatar Jan 11 '25 12:01 darthlite

Hi,

I'm not able to reproduce this issue.

Could you please show the same situation as in the video, and this time right-click on Word in the Dock? Then left-click it?

Also, AltTab was opened before Word, correct?

Thank you

lwouis avatar Jan 11 '25 15:01 lwouis

I face this issue as well. This feature was working so well up until Jan 3 for me after which I switched to a new mac and now things stopped working.

surajk16 avatar Jan 12 '25 02:01 surajk16

Could you both confirm that the issue happens with the latest v7.18.0 version, as well? Thank you

lwouis avatar Jan 12 '25 06:01 lwouis

Hi,

I'm not able to reproduce this issue.

Could you please show the same situation as in the video, and this time right-click on Word in the Dock? Then left-click it?

Also, AltTab was opened before Word, correct?

Thank you

I changed from Word to VSCodium just because Word had private info when app was open, but behavior is the same. And yes, AltTab was opened before VSCodium as seen in the video.

https://github.com/user-attachments/assets/2ee8fb2d-8a90-4783-a77c-5be29d9e9beb

Could you both confirm that the issue happens with the latest v7.18.0 version, as well? Thank you

I have updated to v7.18.0 before recording the video. Behavior is the same. I saw a windowless app (Word, actually) when I went to the switcher immediately after updating AltTab, but when I quit Word and launched it again, then exited all windows, it didn't appear in the switcher.

darthlite avatar Jan 12 '25 19:01 darthlite

I updated to 7.19.0 and it resolved one issue that I was facing - which is not focus/open a window that was actually open. But I still face the issue wherein there is actually no open window in Mac, but I still see a dot on the taskbar which means it wasn't fully quit. Previously I would see that as well in alt tab which would give me an option to quit the window entirely hence removing the dot from the taskbar as well.

surajk16 avatar Jan 14 '25 20:01 surajk16

Could you please run AltTab through the Terminal with this command /Applications/AltTab.app/Contents/MacOS/AltTab --logs=debug, and share the logs here? I'm interested especially with what's written after the last window of the app is closed.

Thank you

lwouis avatar Jan 14 '25 21:01 lwouis

Hopefully I got this right, but this is what I see outputted after closing the last window of the app:

08:19:05 DEBG SystemPermissions.swift:73 checkPermissionsWhileAltTabIsRunning() granted granted true granted false false
08:19:05 DEBG SystemPermissions.swift:75 checkPermissionsWhileAltTabIsRunning() granted
08:19:05 DEBG SystemPermissions.swift:82 checkPermissionsWhileAltTabIsRunning() granted
08:19:05 DEBG RunningApplicationsEvents.swift:17 handleEvent() [(59475, "com.apple.WebKit.GPU")]
08:19:09 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
08:19:09 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 59159 VSCodium
08:19:09 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 1048840) false NSEventModifierFlags(rawValue: 0)
08:19:09 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 256) false NSEventModifierFlags(rawValue: 1048576)
08:19:10 DEBG SystemPermissions.swift:73 checkPermissionsWhileAltTabIsRunning() granted granted true granted false false
08:19:10 DEBG SystemPermissions.swift:75 checkPermissionsWhileAltTabIsRunning() granted
08:19:10 DEBG SystemPermissions.swift:82 checkPermissionsWhileAltTabIsRunning() granted
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 1048840) false NSEventModifierFlags(rawValue: 0)
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 down nil nil false NSEventModifierFlags(rawValue: 1048576)
08:19:10 INFO ATShortcut.swift:73 executeAction() executeAction nextWindowShortcut
08:19:10 DEBG App.swift:229 showUiOrCycleSelection() 0 0 true
08:19:10 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
08:19:10 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
08:19:10 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
08:19:10 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 256) false NSEventModifierFlags(rawValue: 0)
08:19:10 INFO ATShortcut.swift:73 executeAction() executeAction holdShortcut
08:19:10 INFO App.swift:123 focusTarget() 45950 p10k Modified Colors (AltTab) 764 com.googlecode.iterm2
08:19:10 INFO App.swift:71 hideUi() true
08:19:10 INFO AccessibilityEvents.swift:15 handleEvent() AXFocusedWindowChanged 57757
08:19:10 DEBG KeyRepeatTimer.swift:28 deactivateTimerForRepeatingKey() nextWindowShortcut
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 up nil nil false NSEventModifierFlags(rawValue: 0)
08:19:10 INFO AccessibilityEvents.swift:15 handleEvent() AXWindowCreated 57757 nil
08:19:10 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
08:19:10 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 764 iTerm2
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 1048840) false NSEventModifierFlags(rawValue: 0)
08:19:10 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 256) false NSEventModifierFlags(rawValue: 1048576)

darthlite avatar Jan 15 '25 05:01 darthlite

10:17:10 DEBG Window.swift:54 init() Adding window 2012 mac hide taskbar - Google Search - Google Chrome com.google.Chrome
10:17:10 DEBG Window.swift:54 init() Adding window 1965 facebook.csod.com/lms/scorm/clientLMS/LMS3.aspx?rNum=1&aicc_sid=23575690facebook&packageId=B0&qs=%5e%5e%5eZ8IleCPViMgEMnExZMFculS9AvLAbwnzFS2cgqam%2b%2bWLYF7hv%2fR1pqtuza5FG3uZfMn427XfE%2b5d59Um6akuuHs%2bUHLpJx5lQV0AgtSe%2bopSpFTcEZoRiETwc5j7QXYvRm6YcWBa8T3iJ57r%2facUy17gwcAYNasxg4T8EvwjiohPmL87twONIDFvKyGWglC%2fmNirBys1M8%2fFV250UXsz9GAEW%2bv66GiK8eo8R2UULZM%3d - Google Chrome com.google.Chrome
10:17:10 DEBG Window.swift:54 init() Adding window 589 Workplace Chat workplace-desktop
10:17:10 DEBG Window.swift:54 init() Adding window 1978 Windowless Apps Not Showing in Switcher · Issue #4108 · lwouis/alt-tab-macos - Google Chrome com.google.Chrome
10:17:10 DEBG Window.swift:54 init() Adding window 2349 Windowless Apps Not Showing in Switcher · Issue #4108 · lwouis/alt-tab-macos - Google Chrome com.google.Chrome
10:17:10 DEBG Window.swift:54 init() Adding window 2404 sudharsan — AltTab --logs=debug — 80×24 com.apple.Terminal
10:17:10 DEBG Window.swift:54 init() Adding window 2418 Notes com.apple.Notes
10:17:13 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 1048840) false NSEventModifierFlags(rawValue: 0)
10:17:13 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 down nil nil false NSEventModifierFlags(rawValue: 1048576)
10:17:13 INFO ATShortcut.swift:73 executeAction() executeAction nextWindowShortcut
10:17:13 DEBG App.swift:229 showUiOrCycleSelection() 0 0 true
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
10:17:13 INFO AccessibilityEvents.swift:15 handleEvent() AXFocusedWindowChanged 56777
10:17:13 INFO AccessibilityEvents.swift:15 handleEvent() AXWindowCreated 56777
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:13 INFO AccessibilityEvents.swift:15 handleEvent() AXFocusedWindowChanged 56777
10:17:13 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:13 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 up nil nil false NSEventModifierFlags(rawValue: 1048576)
10:17:13 DEBG KeyRepeatTimer.swift:28 deactivateTimerForRepeatingKey() nextWindowShortcut
10:17:14 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 256) false NSEventModifierFlags(rawValue: 0)
10:17:14 INFO ATShortcut.swift:73 executeAction() executeAction holdShortcut
10:17:14 INFO App.swift:123 focusTarget() 2418 Notes 78395 com.apple.Notes
10:17:14 INFO App.swift:71 hideUi() true
10:17:14 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
10:17:14 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 78395 Notes
10:17:15 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 1048840) false NSEventModifierFlags(rawValue: 0)
10:17:15 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 down nil nil false NSEventModifierFlags(rawValue: 1048576)
10:17:15 INFO ATShortcut.swift:73 executeAction() executeAction nextWindowShortcut
10:17:15 DEBG App.swift:229 showUiOrCycleSelection() 0 0 true
10:17:15 DEBG SystemPermissions.swift:73 checkPermissionsWhileAltTabIsRunning() granted granted true granted false false
10:17:15 DEBG SystemPermissions.swift:75 checkPermissionsWhileAltTabIsRunning() granted
10:17:15 DEBG SystemPermissions.swift:82 checkPermissionsWhileAltTabIsRunning() granted
10:17:15 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:15 DEBG AccessibilityEvents.swift:7 AltTab() AXFocusedWindowChanged
10:17:15 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
10:17:15 DEBG AccessibilityEvents.swift:7 AltTab() AXWindowCreated
10:17:15 INFO AccessibilityEvents.swift:15 handleEvent() AXFocusedWindowChanged 56777
10:17:15 INFO AccessibilityEvents.swift:15 handleEvent() AXWindowCreated 56777
10:17:15 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
10:17:15 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 78258 Terminal
10:17:15 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() 0 up nil nil false NSEventModifierFlags(rawValue: 0)
10:17:15 DEBG KeyRepeatTimer.swift:28 deactivateTimerForRepeatingKey() nextWindowShortcut
10:17:15 INFO App.swift:123 focusTarget() 2404 sudharsan — AltTab --logs=debug — 80×24 78258 com.apple.Terminal
10:17:15 INFO App.swift:71 hideUi() true
10:17:15 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 256) false NSEventModifierFlags(rawValue: 0)
2025-01-15 10:17:16.195 AltTab[78847:1638269] +[IMKClient subclass]: chose IMKClient_Modern
2025-01-15 10:17:16.195 AltTab[78847:1638269] +[IMKInputSession subclass]: chose IMKInputSession_Modern
10:17:17 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
10:17:17 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 78395 Notes
10:17:20 DEBG AccessibilityEvents.swift:7 AltTab() AXApplicationActivated
10:17:20 INFO AccessibilityEvents.swift:15 handleEvent() AXApplicationActivated 78258 Terminal
10:17:20 DEBG SystemPermissions.swift:73 checkPermissionsWhileAltTabIsRunning() granted granted true granted false false
10:17:20 DEBG SystemPermissions.swift:75 checkPermissionsWhileAltTabIsRunning() granted
10:17:20 DEBG SystemPermissions.swift:82 checkPermissionsWhileAltTabIsRunning() granted
10:17:21 DEBG KeyboardEventsTestable.swift:16 handleKeyboardEvent() nil nil nil NSEventModifierFlags(rawValue: 262401) false NSEventModifierFlags(rawValue: 0)
^C

In this I closed the Notes window, it disappears from AltTab but shows up in the dock as though it is open (with a dot indicator).

surajk16 avatar Jan 15 '25 15:01 surajk16

I think this issue has the same root cause as https://github.com/lwouis/alt-tab-macos/issues/3589. That is, the OS is not sending us the event about the window being destroyed.

The difference with https://github.com/lwouis/alt-tab-macos/issues/3589 is that the window is no longer shown in the switcher here, whereas it remains shown in the other ticket.

I haven't implemented the workaround for https://github.com/lwouis/alt-tab-macos/issues/3589. Few users have complained, so I assumed that macOS had pushed a fix for this. They may have actually. I see that OP is on macOS 15.1.1 which is not the latest. Perhaps everyone who reported here is not on the latest.

Could you please try updating your macOS to the latest? The root cause of this issue is a bug in macOS, not reporting windows being closed.

Another thing that people in https://github.com/lwouis/alt-tab-macos/issues/3589 have found success with is to quit specific app that contribute to trigger the OS bug. Please see if you run those, and try to not run them to see if the bug goes away.

If it still happens, it means that the issue is not solved for everyone. Depending on the number of people reporting the issue in this ticket and the other ticket, I may need to implement the workaround from yabai.

Thank you

lwouis avatar Jan 15 '25 17:01 lwouis

image

I'm running 15.2 and it says I'm on the latest version though.

surajk16 avatar Jan 15 '25 18:01 surajk16

I have just upgraded to 15.2, and the issue did not go away unfortunately.

Is it normal that the issue would only occur for some users given it's a macOS bug?

darthlite avatar Jan 16 '25 16:01 darthlite

@darthlite yes, Apple seem to do A/B testing. See #3973 for instance. It could also be happening only under some circumstances (e.g. using some apps like people have reported above).

lwouis avatar Jan 16 '25 18:01 lwouis

Interesting. Works fine for me, and it justifies me sticking to Sonoma 14 for now. LOL

ADTC avatar Jan 17 '25 11:01 ADTC

Hi,

Could you https://github.com/lwouis/alt-tab-macos/issues/4194#issuecomment-2635217331? it might resolve this issue as well

Thank you

lwouis avatar Feb 04 '25 23:02 lwouis

@lwouis The build that you had linked actually resolved this issue! Thanks

Edit 1: It worked for the very first time I installed and opened the app. After that the same issue persists. Edit 2: It works when I quit and reopen the app for the first time. Then on it stops working.

surajk16 avatar Feb 07 '25 18:02 surajk16

Hi @surajk16 and @darthlite,

Could you please let me know if the latest release fixes this issue for you?

Thank you 🙇

lwouis avatar Feb 20 '25 22:02 lwouis

I upgraded to 7.21.0. I had the same exact experience as @surajk16: when I first launch the app it detects apps that have no windows and shows them, but if I quit and restart the same app and close all windows, it doesn't show.

However, I recall having this exact experience before (not specific to this version).

darthlite avatar Feb 22 '25 09:02 darthlite

Thank you @darthlite

I think we are back to https://github.com/lwouis/alt-tab-macos/issues/4108#issuecomment-2593490074

lwouis avatar Feb 22 '25 09:02 lwouis

I hope I'm not speaking prematurely, but it seems the problem has somehow resolved itself with no change from my side. The only thing that I can remember doing is updating macOS (I'm now on 15.3.2). Also still on AltTab 7.21.0 (from before).

I now see windowless apps appearing in the launcher!

darthlite avatar Mar 17 '25 09:03 darthlite

I updated to the latest version, 15.3.2, and the application is also up-to-date. However, I still encountered this issue. When the application starts, it can detect applications without any open windows; but after opening an application’s window and then closing all of its windows, it no longer recognizes the existence of that application.

yttyytty avatar Mar 21 '25 08:03 yttyytty

@lwouis this is also happening to me with the finder. I have specifically looked very carefully at the blacklist settings, and have tried deleting, re-adding, and toggling settings to fix. But still, the finder hides from alt-tab if I don't have an open finder window. Which is actually a big problem for my workflow because I very often need to get back into finder. I opened up a new issue today detailing the problem: https://github.com/lwouis/alt-tab-macos/issues/4495

mathewharwich avatar May 19 '25 04:05 mathewharwich

When launching Alttab for the first time, I can see applications without windows, but after opening an application without a window and then executing cmd+w to close it, I can no longer see that application in switcher.

ChihGodlee avatar Jun 03 '25 09:06 ChihGodlee