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

AltTab can't focus another window if Flock.app window is focused

Open alt-tab-macos-bot opened this issue 2 years ago • 4 comments

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

Message:

When Flock messenger is the active window, AltTab is unable to change the window focus to anything else, though regular app switcher works as expected

alt-tab-macos-bot avatar Jun 06 '22 12:06 alt-tab-macos-bot

I downloaded the mac app, and was able to reproduce the issue.

It seems that _SLPSSetFrontProcessWithOptions doesn't work well with this app. It triggers 2 OS events:

  • Focus the app (from _SLPSSetFrontProcessWithOptions)
  • Focus back Flock

To focus app, we have only the public API: NSApplication.activate but it brings forward the main window, which we don't want. So we are forced to use the private API _SLPSSetFrontProcessWithOptions so avoid that. I also tried __SLPSSetFrontProcessWithOptions and _SLPSSetFrontProcess, but all have the same glitch from Flock.

@koekeishiya any idea why this app would not work well with _SLPSSetFrontProcessWithOptions? I checked again in yabai, and you still focus the same way, with this API. So this app is probably also broken on yabai.

lwouis avatar Jun 07 '22 09:06 lwouis

Have the same issue here, but mine's with IntelliJ and Slack, it seems that alt-tab doesn't unfocus/focus them again, causing weird behaviors, such as: files not being updated (IntelliJ) and notifications badge appearing/disappearing instantly (Slack). I'm stuck on version 1.39, since this issue doesn't happen with it. Is there anything I could do to help finding this issue's root cause?

drauziooppenheimer avatar Jul 27 '22 11:07 drauziooppenheimer

@drauziooppenheimer not many solutions I'm afraid. We have to use private APIs because Apple doesn't support focusing windows from other Space through any public API. So we are already going beyond what's supposed to be possible, now if it doesn't cover 100%, it's basically retro-engineer and R&D.

Previous discussion: https://github.com/lwouis/alt-tab-macos/issues/922

lwouis avatar Jul 27 '22 16:07 lwouis

Could this be fixed with an optional workaround to send the M signal to the application refusing to give up focus? That's what I do manually and it seems to work okay, as the application is getting un-minimized upon selecting it with AltTab.

crabique avatar Jul 29 '23 11:07 crabique