lwouis / alt-tab-macos

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

v6.70.0 sometimes crashes #3392

Closed stevehoek closed 5 months ago

stevehoek commented 5 months ago

Describe the bug

Upgraded to 6.7.0 today and noticed after a few minutes of alt-tab'ing between applications, including some fullscreen ones (Microsoft Remote Desktops, Parsec remote desktop) eventually alt-tab stops doing anything and I look and Alt-Tab's menu bar icon is gone. When I restart it asks to send a crash report, which I do, but then it doesn't run successfully after that.

Steps to reproduce the bug

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Your environment

lwouis commented 5 months ago

Hi,

I've looked into the issue. Indeed, it seems to have starte with v6.70.0. There are crash reports from a few machines:

image

Looking into the crash logs, I can't make sense of it. I don't see how the changes introduced in v6.70.0 would interact with the part of the codebase which crashes.

Exception Type:  SIGTRAP
Exception Codes: TRAP_BRKPT at 0x1023e2d50
Crashed Thread:  0

Thread 0 Crashed:
0   AltTab                               0x00000001023e2d50 AltTab.ThumbnailView.updateRecycledCellWithNewContent(AltTab.Window, Swift.Int, CoreGraphics.CGFloat, __C.NSScreen) -> () (ThumbnailView.swift:0)
1   AltTab                               0x00000001023f4334 AltTab.ThumbnailsView.(layoutThumbnailViews in _D643EB5E228DE3B325D7E55FB9CD42C9)(__C.NSScreen, CoreGraphics.CGFloat) -> (CoreGraphics.CGFloat, CoreGraphics.CGFloat)? (ThumbnailsView.swift:111)
2   AltTab                               0x00000001023f3f00 AltTab.ThumbnailsView.updateItemsAndLayout(__C.NSScreen) -> () (ThumbnailsView.swift:80)
3   AltTab                               0x00000001023db908 AltTab.App.refreshOpenUi([AltTab.Window]?) -> () (App.swift:259)
4   AltTab                               0x00000001023dcd9c AltTab.App.rebuildUi(__C.NSScreen) -> () (App.swift:319)
5   AltTab                               0x00000001023de23c $s6AltTab3AppC22showUiOrCycleSelectionyySiFyyScMYccfU0_TA (App.swift:303)
6   AltTab                               0x00000001023d4650 reabstraction thunk helper from @escaping @callee_guaranteed () -> () to @escaping @callee_unowned @convention(block) () -> () (<compiler-generated>:0)
7   libdispatch.dylib                    0x0000000190780750 _dispatch_call_block_and_release + 28
8   libdispatch.dylib                    0x00000001907823e8 _dispatch_client_callout + 16
9   libdispatch.dylib                    0x0000000190790bb8 _dispatch_main_queue_drain + 984
10  libdispatch.dylib                    0x00000001907907cc _dispatch_main_queue_callback_4CF + 40
11  CoreFoundation                       0x0000000190a53ad4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
12  CoreFoundation                       0x0000000190a11258 __CFRunLoopRun + 1992
13  CoreFoundation                       0x0000000190a10434 CFRunLoopRunSpecific + 604
14  HIToolbox                            0x000000019b1b419c RunCurrentEventLoopInMode + 288
15  HIToolbox                            0x000000019b1b3fd8 ReceiveNextEventCommon + 644
16  HIToolbox                            0x000000019b1b3d30 _BlockUntilNextEventMatchingListInModeWithFilter + 72
17  AppKit                               0x000000019426fd68 _DPSNextEvent + 656
18  AppKit                               0x0000000194a65808 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 696
19  AppKit                               0x000000019426309c -[NSApplication run] + 472
20  AltTab                               0x00000001023ad128 main (main.swift:12)
21  ???                                  0x00000001905aa0e0 0x0 + 0

I'm not sure how to investigate this further. I can't reproduce the issue locally.

I would probably need more data or insights to find the root cause. As it stands, I don't have any clue where to look to diagnose the issue.

Thank you

stevehoek commented 5 months ago

Sorry to hear the crash's root cause is not immediately evident. Let me know if I can help further (debug build, etc). For now I will stick with 6.69

lwouis commented 5 months ago

Thank you @stevehoek.

Are you a developer? If you are, you could run the app from source on your machine, and it would show us exactly why it crashes.

stevehoek commented 5 months ago

I'm a Windows desktop dev and web dev, but I pulled down the repo and tried to build with latest Xcode.

First I had to change the settings to use my own developer certificate in provisioning.

Now I have a build error "No such module 'ShortcutRecorder'"... is that a third party lib?

salman-ar-sar commented 5 months ago

I am also facing the same issue. Randomly crashes very frequently silently.

@lwouis Are there any steps to run the app from source? I could also try and provide some logs if needed.

lwouis commented 5 months ago

Here are the 2 steps to get going on the project.

@stevehoek ShortcutRecorder is a library we use indeed. It's present after a git clone normally. You don't need to install it. You may have an incorrect setup with XCode. It you use XCode UI, you need to open the .xcworkspace file 👍

lwouis commented 5 months ago

Is there a series of steps you know that lead to the crash 100%? If I could reproduce it locally, I could debug it on my side as well.

salman-ar-sar commented 5 months ago

Is there a series of steps you know that lead to the crash 100%? If I could reproduce it locally, I could debug it on my side as well.

In my case there were no particular series of steps as it was random. When I pressed opt + tab to navigate it was not appearing.

Here are the 2 steps to get going on the project.

@stevehoek ShortcutRecorder is a library we use indeed. It's present after a git clone normally. You don't need to install it. You may have an incorrect setup with XCode. It you use XCode UI, you need to open the .xcworkspace file 👍

I think the link is not complete. I'm getting navigated to issues tab.

lwouis commented 5 months ago

@salman-ar-sar sorry about this. I fixed the link 👍

stevehoek commented 5 months ago

Thanks, that link is helpful... however, I get this when trying to gen a local codesign cert

./scripts/codesign/setup_local.sh
+ certificateFile=codesign
++ openssl rand -base64 12
+ certificatePassword=5YAxs+uO4/76fSHx
+ scripts/codesign/generate_selfsigned_certificate.sh codesign 5YAxs+uO4/76fSHx
+ certificateFile=codesign
+ certificatePassword=5YAxs+uO4/76fSHx
+ cat
+ openssl genrsa -out codesign.key 2048
+ openssl req -x509 -new -config codesign.conf -nodes -key codesign.key -extensions extensions -sha256 -out codesign.crt
+ openssl pkcs12 -export -inkey codesign.key -in codesign.crt -out codesign.p12 -passout pass:5YAxs+uO4/76fSHx
+ scripts/codesign/import_certificate_into_main_keychain.sh codesign 5YAxs+uO4/76fSHx
+ certificateFile=codesign
+ certificatePassword=5YAxs+uO4/76fSHx
+ security import codesign.p12 -P 5YAxs+uO4/76fSHx -T /usr/bin/codesign
security: SecKeychainItemImport: MAC verification failed during PKCS12 import (wrong password?)
stevehoek commented 5 months ago

Using my own Apple dev account to build the debug, I get 4 build errors in GeneralTab.swift along the lines of

Value of type 'LSSharedFileListItem?' has no member 'takeRetainedValue'

lwouis commented 5 months ago

@stevehoek Sorry about this. New versions of openssl have broken the script I think. Same for the code. New versions of XCode broke a few lines I think.

I suggest to just comment out code that throws an error. It's probably fine and unrelated to this ticket.

stevehoek commented 5 months ago

From what I can tell, if there are other full-screen apps such as Microsoft Remote Desktop or Parsec Remote Desktop in my case, it happens more frequently. I can't test for too long without these windows open, but in some limited testing of 30min at a time today I could not repro the bug, but once I had some of these full screen windows open it did crash silently

lwouis commented 5 months ago

If it's possible, I suggest running AltTab from XCode, in debug run. This way, when it crashes eventually, it will stop on the line throwing the error, and you'll probably see which variables is nil or what other cause is at play

stevehoek commented 5 months ago

Unfortunately I'm not able to build it. I commented out lines in one file then got more errors in another file. Any reason you don't build with the latest Xcode version? Seems hard to hold down your Xcode version than just float with it as new versions of macOS are released.

lwouis commented 5 months ago

The app is built released with CI/CD. It's easier to keep XCode stable on my machine + the CI VM, versus the constant changes.

areynaldos commented 5 months ago

I have the same issue and can reproduce all the time (started in version 6.7.0):

The only solution is to relaunch Alt-Tab and quit it (click on the icon, Quit).

I can also reproduce by launching Alt-Tab and interacting with the icon (for example, selecting Settings).

lwouis commented 5 months ago

@areynaldos could you please share a video of these steps so we can see it?

f4bkey commented 5 months ago

@lwouis I am experiencing the same issues as others here. If you guide me on what to look for in the log stream i can provide the necessary data from terminal. Just let me know.

JavierCane commented 5 months ago

It seems that if you have AltTab set to the default Cmd+Tab shortcut, you cannot switch apps with Cmd+Tab after AltTab crashes. Neither AltTab nor the default macOS app switcher will run. I have to admit that this behavior was quite confusing until I thought about AltTab 😅

How to recover the default macOS behavior: In the meantime, if you are also affected by this issue, here is a fix (solution originally pointed out by @areynaldos, adding this detailed step-by-step just in case it helps anyone else):

  1. Open AltTab (double-click on /Applications/AltTab.app or execute open /Applications/AltTab.app in Terminal).
  2. Try to switch between apps with Cmd+Tab. This will cause AltTab to crash leaving it running but in an inconsistent state. The first time I tried to kill the app via Activity Monitor or even with killAll AltTab, but it did not bring the default macOS switcher back, so it seems you actually have to quit it via its UI.
  3. Open AltTab again to wake the user interface (double-click on /Applications/AltTab.app or execute open /Applications/AltTab.app in Terminal). It seems that, due to being in an inconsistent state, you have to execute this step twice.
  4. Quit AltTab via its UI Quit option: 2024_05_31-13_14_19

Hope it helps other users not get stuck without app switcher, and give you time to rollback/find the issue in the meantime. Crash report already reported 🤞😊

WarrenFaith commented 5 months ago

Maybe two cents from me: I am using two desktops in my setup (3 screens) and it works flawlessly if I only have one window in a desktop. On the other hand it crashes immediately as soon as I have more than one window (for example Chrome) open.

I am not using cmd+tab but option+tab to have both possibilities.

I made a downgrade to 6.69.0 without changing any of my windows or setup and this version is working.

lwouis commented 5 months ago

I'm not managing to reproduce the crash. I've tried with 2 screens, multiple Spaces, fullscreening windows. It doesn't crash for me.

Is anyone able to get consistent steps to reproduce the issue? Could anyone share a video of the crash, so I can see what the setup is like, at the time of the crash?

Finally, if you're a developer, you can run the app in debug mode, then when it crash you'll get pointed at the crash site and will be able to see which variables are causing the issue.

areynaldos commented 5 months ago

@lwouis :

@areynaldos could you please share a video of these steps so we can see it?

I am attaching the recording here in Dropbox.

For me, it is easy to reproduce every time: just run AltTab and click cmd+tab.

What I did:

  1. With macOS in default, I click cmd+tab. You'll see the normal macOS switcher.
  2. Then I ran AltTab. I pointed at it in the top bar.
  3. I click cmd-tab and AltTab crashes. You see it disappear from the top. I keep on clicking cmd+tab but nothing happens.
  4. I go back to recover from the inconsistent state: open AltTab again, and Quit through it's menu.
  5. Then I open AltTab again, open Preferences, everything is OK.
  6. When I click cmd+tab again, AltTab crashes.

Thanks for looking into it!

stevehoek commented 5 months ago

One suggestion: give us a build off of master with the changes in 6.70 reverted and if that has an issue, we know it is something to do with latest macOS and your older CI/CD pipeline. If no issue, add back some of the changes to try to see what of that PR is causing it.

I notice you release debug symbols with each version... would that help you? Or could you give us a debug version with trace statements that would show up in the macOS log viewer? Does Alt-Tab have a log file?

lwouis commented 5 months ago

Here's a build of AltTab with logs near the crash site.

Could you please run it from Terminal.app (e.g. by running this command: /Applications/AltTab.app/Contents/MacOS/AltTab) and share here the logs you get when it crashes. Only the logs at the end are needed. No need for all the launch logs.

Thank you 🙇

djschny commented 5 months ago

Experiencing it as well.

stevehoek commented 5 months ago

Got the crash right away... started the version of AltTab you linked above from Terminal, had to enable the 2 permissions for Terminal, then I clicked with my trackpad on each open window, starting with the non-full screen ones first then the 3 full-screen ones that I have open. Then I hit Command+Tab and it did nothing so I looked at Terminal and saw the logging ending with a TRAP

Optional("com.cocoatech.PathFinder") Optional("") 3 0 Optional("AXUnknown") Optional("AXWindow") Optional((200.0, 200.0))
Optional("com.cocoatech.PathFinder") Optional("") 3 0 Optional("AXUnknown") Optional("AXWindow") Optional((200.0, 200.0))
Optional("com.cocoatech.PathFinder") Optional("") 3 0 Optional("AXUnknown") Optional("AXWindow") Optional((200.0, 200.0))
Optional("com.cocoatech.PathFinder") Optional("") 3 0 Optional("AXUnknown") Optional("AXWindow") Optional((200.0, 200.0))
Optional("com.cocoatech.PathFinder") Optional("Downloads") 0 0 Optional("AXStandardWindow") Optional("AXWindow") Optional((1058.0, 874.0))
"Accessibility event" "AXWindowCreated" ""
Optional("tv.parsec.www") Optional("") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 37.0))
Optional("com.junebytes.TotalXDR") Optional("") 24 0 Optional("AXSystemDialog") Optional("AXWindow") Optional((1.0, 1.0))
"Accessibility event" "AXFocusedWindowChanged" "Spotify Premium"
"Accessibility event" "AXMainWindowChanged" "Spotify Premium"
"Accessibility event" "AXApplicationActivated" "Spotify"
"showUiOrCycleSelection"
"showUiOrCycleSelection: isFirstSummon"
"Accessibility event" "AXFocusedWindowChanged" ""
"Accessibility event" "AXWindowCreated" ""

"-->" <AltTab.ThumbnailView: 0x133f0a0f0> AltTab.Window 0 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x143e56840> AltTab.Window 1 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x143e5c470> AltTab.Window 2 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x143e66200> AltTab.Window 3 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x145812610> AltTab.Window 4 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x13483c6f0> AltTab.Window 5 181.0 <NSScreen: 0x600002e13de0; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

zsh: trace trap  /Applications/AltTab.app/Contents/MacOS/AltTab
stevehoek commented 5 months ago

I tried again and it crashed and I had not activated any of the full-screen windows. I have 5 spaces/desktops, if that helps at all... plus the 3 full screen windows.

Optional("com.surteesstudios.Bartender") Optional("MenuBarRoundedCover") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 49.0))
Optional("com.surteesstudios.Bartender") Optional("MenuBarCover") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 38.0))
"Accessibility event" "AXApplicationActivated" "Terminal"
"OS event" "activeSpaceDidChangeNotification"
"Current space" 5
Optional("com.google.Chrome") Optional("Steve @ Home - Google Chrome - Steve (Steve @ Home)") 0 0 Optional("AXStandardWindow") Optional("AXWindow") Optional((1209.0, 873.0))
Optional("com.junebytes.TotalXDR") Optional("") 24 0 Optional("AXSystemDialog") Optional("AXWindow") Optional((1.0, 1.0))
Optional("com.apple.Terminal") Optional("Downloads — AltTab — 80×44") 0 0 Optional("AXStandardWindow") Optional("AXWindow") Optional((730.0, 874.0))
Optional("com.surteesstudios.Bartender") Optional("MenuBarRoundedCover") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 49.0))
Optional("com.surteesstudios.Bartender") Optional("MenuBarCover") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 38.0))
Optional("com.surteesstudios.Bartender") Optional("DesktopWallpaperHelperWindow") -2147483623 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 982.0))
Optional("com.replay.sleeve") Optional("") -20 0 Optional("AXDialog") Optional("AXWindow") Optional((540.0, 248.0))
"Accessibility event" "AXWindowCreated" ""
Optional("com.sergey-gerasimenko.DockView") Optional("") 0 0 Optional("AXUnknown") Optional("AXWindow") Optional((263.0, 207.0))
"showUiOrCycleSelection"
"showUiOrCycleSelection: isFirstSummon"

"Accessibility event" "AXFocusedWindowChanged" ""

"Accessibility event" "AXWindowCreated" ""

"-->" <AltTab.ThumbnailView: 0x126127230> AltTab.Window 0 181.0 <NSScreen: 0x600000d69b60; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x124f51bb0> AltTab.Window 1 181.0 <NSScreen: 0x600000d69b60; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

"-->" <AltTab.ThumbnailView: 0x124f5b250> AltTab.Window 2 181.0 <NSScreen: 0x600000d69b60; name="Built-in Retina Display"; backingScaleFactor=2.000000; frame={{0, 0}, {1512, 982}}; visibleFrame={{0, 70}, {1512, 874}}>

zsh: trace trap  /Applications/AltTab.app/Contents/MacOS/AltTab
lwouis commented 5 months ago

Thank you. Could you please record a crash with this build? 🙇‍♂️

stevehoek commented 5 months ago

Here is the crash with the build from the previous post

"showUiOrCycleSelection"
"showUiOrCycleSelection: isFirstSummon"
"Accessibility event" "AXFocusedWindowChanged" ""
"Accessibility event" "AXWindowCreated" ""

"-->" 0 ["cgWindowId: Optional(581)", "lastFocusOrder: 0", "creationOrder: 3", "title: Optional(\"Spotify Premium\")", "thumbnail: Optional(<NSImage 0x60000183dae0 Size={1058, 873} RepProvider=<NSImageArrayRepProvider: 0x600002b88480, reps:(\n    \"<NSCGImageSnapshotRep:0x60000097cf50 cgImage=<CGImage 0x12491adc0> (DP)\\n\\t<<CGColorSpace 0x600000d18b40> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Color LCD)>\\n\\t\\twidth = 1058, height = 873, bpc = 8, bpp = 32, row bytes = 4352 \\n\\t\\tkCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little  | kCGImagePixelFormatPacked \\n\\t\\tis mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? No>\"\n)>>)", "thumbnailFullSize: Optional((1058.0, 873.0))", "shouldShowTheUser: true", "isTabbed: false", "isFullscreen: false", "isMinimized: false", "isOnAllSpaces: false", "isWindowlessApp: false", "position: Optional((226.0, 38.0))", "size: Optional((1058.0, 873.0))", "spaceId: 1", "spaceIndex: 1", "axUiElement: Optional(<AXUIElement 0x60000259ea60> {pid=1886})", "application: <AltTab.Application: 0x600000d80ea0>", "axObserver: Optional(<AXObserver 0x600000ae2a30> {pid=1886})", "row: nil"]

"-->" 1 ["cgWindowId: Optional(30615)", "lastFocusOrder: 1", "creationOrder: 1", "title: Optional(\"Downloads — AltTab — 80×44\")", "thumbnail: Optional(<NSImage 0x60000185c3c0 Size={730, 874} RepProvider=<NSImageArrayRepProvider: 0x600002b94490, reps:(\n    \"<NSCGImageSnapshotRep:0x600000978370 cgImage=<CGImage 0x1248141d0> (DP)\\n\\t<<CGColorSpace 0x600000d18b40> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Color LCD)>\\n\\t\\twidth = 730, height = 874, bpc = 8, bpp = 32, row bytes = 2944 \\n\\t\\tkCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little  | kCGImagePixelFormatPacked \\n\\t\\tis mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? No>\"\n)>>)", "thumbnailFullSize: Optional((730.0, 874.0))", "shouldShowTheUser: true", "isTabbed: false", "isFullscreen: false", "isMinimized: false", "isOnAllSpaces: false", "isWindowlessApp: false", "position: Optional((782.0, 38.0))", "size: Optional((730.0, 874.0))", "spaceId: 5", "spaceIndex: 3", "axUiElement: Optional(<AXUIElement 0x6000026ca7f0> {pid=44115})", "application: <AltTab.Application: 0x600000d82820>", "axObserver: Optional(<AXObserver 0x600000ae2670> {pid=44115})", "row: Optional(0)"]

"-->" 2 ["cgWindowId: Optional(8349)", "lastFocusOrder: 2", "creationOrder: 4", "title: Optional(\"AnyGo\")", "thumbnail: Optional(<NSImage 0x60000183d540 Size={1008, 630} RepProvider=<NSImageArrayRepProvider: 0x600002b89460, reps:(\n    \"<NSCGImageSnapshotRep:0x60000097d040 cgImage=<CGImage 0x12491b2c0> (DP)\\n\\t<<CGColorSpace 0x600000d18b40> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Color LCD)>\\n\\t\\twidth = 1008, height = 630, bpc = 8, bpp = 32, row bytes = 4096 \\n\\t\\tkCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little  | kCGImagePixelFormatPacked \\n\\t\\tis mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? No>\"\n)>>)", "thumbnailFullSize: Optional((1008.0, 630.0))", "shouldShowTheUser: true", "isTabbed: false", "isFullscreen: false", "isMinimized: false", "isOnAllSpaces: false", "isWindowlessApp: false", "position: Optional((252.0, 191.0))", "size: Optional((1008.0, 630.0))", "spaceId: 1", "spaceIndex: 1", "axUiElement: Optional(<AXUIElement 0x60000259f870> {pid=75312})", "application: <AltTab.Application: 0x600000d8e0a0>", "axObserver: Optional(<AXObserver 0x600000f68320> {pid=75312})", "row: nil"]

"-->" 3 ["cgWindowId: Optional(30030)", "lastFocusOrder: 3", "creationOrder: 11", "title: nil", "thumbnail: Optional(<NSImage 0x60000181d4a0 Size={907, 874} RepProvider=<NSImageArrayRepProvider: 0x600002b62110, reps:(\n    \"<NSCGImageSnapshotRep:0x6000009301e0 cgImage=<CGImage 0x12312f740> (DP)\\n\\t<<CGColorSpace 0x600000d18b40> (kCGColorSpaceICCBased; kCGColorSpaceModelRGB; Color LCD)>\\n\\t\\twidth = 907, height = 874, bpc = 8, bpp = 32, row bytes = 3712 \\n\\t\\tkCGImageAlphaPremultipliedFirst | kCGImageByteOrder32Little  | kCGImagePixelFormatPacked \\n\\t\\tis mask? No, has masking color? No, has soft mask? No, has matte? No, should interpolate? No>\"\n)>>)", "thumbnailFullSize: Optional((907.0, 874.0))", "shouldShowTheUser: true", "isTabbed: false", "isFullscreen: false", "isMinimized: false", "isOnAllSpaces: false", "isWindowlessApp: false", "position: Optional((302.0, 38.0))", "size: Optional((907.0, 874.0))", "spaceId: 7", "spaceIndex: 5", "axUiElement: Optional(<AXUIElement 0x600002625f50> {pid=40802})", "application: <AltTab.Application: 0x600000d8ef40>", "axObserver: 

Optional(<AXObserver 0x600000930640> {pid=40802})", "row: nil"]

zsh: trace trap  /Applications/AltTab.app/Contents/MacOS/AltTab
lwouis commented 5 months ago

Thank you. Could you please try out this build? I tried and added a fix in this one.

stevehoek commented 5 months ago

Thank you @lwouis ... this version is working much better so far! What was the fix?

One thing I see different from 6.69 however... my fullscreen window for a remote desktop type app called Parsec is not displaying in the alt-tab carousel.

There are some logs about it when I switch to it manually... but nothing in the logs when I hit Alt-Tab keystroke and the carousel is built

"Accessibility event" "AXWindowCreated" ""
Optional("tv.parsec.www") Optional("") 26 0 Optional("AXUnknown") Optional("AXWindow") Optional((1512.0, 37.0))
"OS event" "activeSpaceDidChangeNotification"
"Current space" 81
"Accessibility event" "AXApplicationActivated" "Parsec"
Optional("tv.parsec.www") Optional("Parsec") 23 0 Optional("AXStandardWindow") Optional("AXWindow") Optional((1512.0, 945.0))
"OS event" "activeSpaceDidChangeNotification"
"Current space" 1
lwouis commented 5 months ago

Good news! I'll release the fix shortly, so that people who update to v6.70.0 can instead update to the next version and don't get the issue 👍

The issue was the following:

In v6.70.0, I added a fix for a case where fullscreen windows were not detected. That fix consisted in getting the isFullscreen value, when the user changes Space. While I did that, I thought it useful to also grab other values such as size, position, title, etc.

I made the mistake of assigning the OS-given title directly. It can be nil sometimes. The fix I used here is to apply the method I use for the title of newly created window: this method uses the app name, if the window name is nil.