Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facebook Messenger doesn't play nicely with AltTab #3692

Open
szhu opened this issue Oct 14, 2024 · 17 comments
Open

Facebook Messenger doesn't play nicely with AltTab #3692

szhu opened this issue Oct 14, 2024 · 17 comments
Labels
bug Something isn't working specific-app Issue which happens only with a specific app unreproducible Need help from the author to reproduce the issue

Comments

@szhu
Copy link

szhu commented Oct 14, 2024

Describe the bug

The official Facebook Messenger app has some issues with AltTab. AltTab is great with all other apps I use, so the root cause of these issues is likely with Messenger itself.

I wanted to report the bugs anyway:

  1. To double-check that these bugs are indeed experienced by other people,
  2. To see if anyone has come up with any workarounds, and/or
  3. To see if there are any low-effort changes to AltTab that can be made to mitigate the issues.

There are two bugs described below. Let me know if it would be helpful to split them into two separate issues.

Bug 1: AltTab sometimes doesn't foreground the main Messenger window

After the Messenger main window has been closed once, focusing it with AltTab doesn't bring it to the foreground.

Screenshots / video

Screen.Recording.2024-10-14.at.1.02.01.AM.mp4

Steps to reproduce the bug

  1. Launch AltTab with default settings.
  2. Launch Messenger.
    • Result: The Messenger main window appears.
  3. Click the red 'X'.
    • Result: The Messenger main window disappears, and is no longer in the AltTab list.
  4. Click Messenger in the Dock.
    • Result: The Messenger main window appears again.
  5. Click another window.
    • Result: The other window becomes focused and in the foreground.
  6. Press the AltTab shortcut and hold down the modifier key.
    • Result: The Messenger window is selected.
  7. Let go of the modifier key.
    • Expected result: The Messenger main window becomes focused and in the foreground.
    • Actual result: The Messenger app becomes focused but not in the foreground.

Bug 2: Sometimes blank "Media Viewer" windows appear in the AltTab list

After the Messenger Media Viewer window has been closed, it still appears in the AltTab list when the Messenger app is hidden. Each time a photo is opened, it creates another such phantom window.

Screenshots / video

Screen.Recording.2024-10-14.at.1.05.22.AM.mp4

Steps to reproduce the bug

  1. Launch AltTab with default settings.
  2. Launch Messenger.
    • The Messenger main window appears.
  3. Find a photo in any chat and click on it.
    • Result: The photo opens in a window titled "Media Viewer".
  4. Click the red 'X'.
    • Result: The Media Viewer window disappears, and is no longer in the AltTab list.
  5. Press Cmd-H.
    • Result: The Messenger main window disappears, and another app becomes focused.
  6. Press the AltTab shortcut and hold the modifier key.
    • Expected result: There should be one Messenger window in the list: the main window.
    • Actual result: The main window is in the list, but so is a blank Media Viewer window. The number of Media Viewer windows there are corresponds to how many times a photo was opened in step 4.
  7. Focus any Messenger window. Press the AltTab shortcut and hold the modifier key.
    • Result: The Media viewer windows are no longer in the AltTab list.

Your environment

  • AltTab version: 7.0.2
  • macOS version: 15.1 Beta (24B5035e)
  • Other relevant info: N/A (no external devices connected)
@szhu szhu added the bug Something isn't working label Oct 14, 2024
@lwouis
Copy link
Owner

lwouis commented Oct 14, 2024

Hi,

Thank you for sharing these issues.

I couldn't reproduce the first issue. It works well in my tests. I wonder if the issue is not with Arc. Does the same thing happen for you if the window on top is TextEdit for instance?

I couldn't reproduce the second issue either. I don't get these phantom windows. Are you on the latest version Messenger? I tested with v220.1.0.5.212.

Thank you 🙇

@lwouis lwouis added the unreproducible Need help from the author to reproduce the issue label Oct 14, 2024
@szhu
Copy link
Author

szhu commented Oct 14, 2024

Thanks for trying to reproduce it. The issue does not seem related to Arc; I tried with Finder and TextEdit instead of Arc (and with Arc not running) and ran into the same issue.

I tried with a new user account and it became impossible to reproduce either bug on a fresh setup. I downloaded some of the apps I normally use, and was eventually able to reproduce the bug again, but not reliably.

This bug appears to be a trickier to narrow down than I had previously thought! I'll spend some more time narrowing a reliably reproducible test case and will report back.

@eskayn
Copy link

eskayn commented Oct 16, 2024

I am in quite a different situation but having a similar window not foreground issue on 15.0.1(24A348)with both AltTab 7.0.2 and 6.73.0.

When I use a software called XLD to open a disc, it will first read the disc by showing a progress bar window. After it is finished the progress bar window disappears and there will be a new XLD window pops up onto the foreground(this is how XLD works).
After that AltTab can not foreground the popped-up XLD window even choose it in AltTab.
I tried a few times but I also found the bug seems to be tricky when I restart or use a new user the issue is gone but it returns after several trials.

@SarcevicAntonio
Copy link

SarcevicAntonio commented Oct 16, 2024

I also have the not appearing in foreground issue on some apps, namely Slack, Telegram and Linear. A restart of either AltTab or the affected apps fixes it for a bit, but after a while the issue reappears. Maybe that's why reproducing it is a bit tricky.

@SarcevicAntonio
Copy link

#3726 is a possible dupe of this

@champagnealexandre
Copy link

Can also confirm this with Facebook Messenger and Slack, among other apps which I can’t think of right now. Switching to these apps with Alfred works (i.e., brings them to the foreground) but not with Alt-Tab. I was wondering if this was an Electron issue but other Electron apps (e.g., the new Claude AI app) work fine. Maybe only some versions are affected.

@lwouis
Copy link
Owner

lwouis commented Nov 4, 2024

I'm not familiar with how Alfred focuses windows. I downloaded it to trial but couldn't figure it out. From this page, it suggest they only handle same-Space focus.

The implementation which AltTab uses is quite tricky. It allows focus in edge-cases such as a minimized window on another Space. This is not possible with public APIs, so AltTab uses tricks. As far as I know, it's the best method known currently.

If anyone knows a better implementation, I'd love to hear about it 👍

@champagnealexandre
Copy link

Yeah actually with Alfred I’m simply using its shortcut to bring it up (its "search box") then type the name of the app I wanna bring forward. It’s more or less equivalent to launching the app (from spotlight or the command line) so if it’s already open this will bring it to the foreground.

One thing that’s weird is that some apps e.g. Facebook Messenger worked until recently. Maybe the update to macOS Sequoia ruined it or something?

@lwouis
Copy link
Owner

lwouis commented Nov 4, 2024

Activating an app is quite different from focusing one window of that app.

AltTab focuses 1 window. For instance, if an app has 10 open window, AltTab will only bring 1 of them to the foreground.

if you use the native app switcher and switch to the app, all 10 of its windows will be brought forewords. I suggest you try it to see for yourself the difference.

If Alfred activates apps then they took the easy route. Focusing one window is really hard, as i explained above. We need to call private APIs

@lwouis lwouis added the specific-app Issue which happens only with a specific app label Nov 6, 2024
@filipef101
Copy link

Same thing with slack, and other apps as mentioned. I personally would be happy if we get an option to specify some apps that get focused on app instead of window. That would solve it :) usally slack, telegram, fb, its always 1 window anyway

@filipef101
Copy link

This might be a common thing with electron apps. It does seem it gets focused, but the window is not brought into foreground 🤔

@filipef101
Copy link

filipef101 commented Nov 21, 2024

A possible fix could be, check if the app only has 1 window. if one window do the regular open app, or execute the bring all to front (speaking abstractly). Possibly do this for certain whitelisted apps if you want to support on the codebase specific app hacks :/
Should be trivial to replicate with slack. The main window never gets focused with alt tab

@lwouis
Copy link
Owner

lwouis commented Nov 21, 2024

Should be trivial to replicate with slack. The main window never gets focused with alt tab

It works correctly on my machine. Are you on the latest AltTab, macOS, and Slack versions?

@champagnealexandre
Copy link

Seems to work for me, at least for Slack and Facebook Messenger. ✅

macOS: Sequoia 15.1.1 (just updated from 15.1)
alt-tab: 7.4.0 (just updated from 7.1.1)
Slack: 4.41.98
Messenger: 223.1.0.2.215

@SarcevicAntonio
Copy link

It always seems to work for me, but after ~30 minutes it breaks again 🙃

macOS: 15.1.1
alt-tab: 7.4.0
Slack: 4.41.97

Screen.Recording.2024-11-21.at.17.53.15.mov

@filipef101
Copy link

I'm almost sure I replicated with Notes app, having two windows, it would never bring the main window to front. But accidentally force quitted the alt tab.. (apparently restarting alt tab even slack starts working again).

Could be worth anyone else when having this issue, trying on notes to confirm if it's or not exclusive to electron apps

@champagnealexandre
Copy link

It always seems to work for me, but after ~30 minutes it breaks again 🙃

Can confirm. Still an issue for me as well even though it briefly worked correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working specific-app Issue which happens only with a specific app unreproducible Need help from the author to reproduce the issue
Projects
None yet
Development

No branches or pull requests

6 participants