lwouis / alt-tab-macos

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

Issues with command+backtick when Stage Manager is enabled #2053

Open claudewowo opened 1 year ago

claudewowo commented 1 year ago

Describe the bug

open Shortcuts - Select previous window, set to ` key which is the key up tab, does not worked on MacOS 13. It works fine on MacOS 12.6. The version is 6.48.0.

Screenshots / video

iShot_2022-10-28_上午10 53 42
lwouis commented 1 year ago

Could you please share a screenshot of the second tab on that window (Shortcut 2)? Thank you

keman5 commented 1 year ago
iShot_2022-10-28_下午5 07 14

gif: iShot_2022-10-28_下午5 05 10

keman5 commented 1 year ago

And I can't change cmd to option on the second tab, it will be a error tip about: Shortcut key conflict

keman5 commented 1 year ago

I changed cmd to the third tab, and still does't works.

iShot_2022-10-28_下午5 13 46
keman5 commented 1 year ago

But I can use option + ` to select previous window. I prefer to use cmd, not others.

lwouis commented 1 year ago

I have set my preferences exactly like you:

Shortcut 1 Shortcut 2
image image

However, everything works great for me. I can use command+tab to open AltTab, then I can press command+` to go backwards.

I suspect it's some issue from an external factor like:

Could you try resetting AltTab preferences (in the first tab of the preferences, at the bottom), and then changing tab to `? Maybe share that process in video so we can see what's happening exactly. For me, everything went smoothly.

keman5 commented 1 year ago

I'm on macos13

record.m4v.zip

please download and unzip.

I pressed cmd + ` at 00:40 - 00:44, but nothing to work.

lwouis commented 1 year ago

Thank you for the video. I see in the video that you use Alfred. Alfred could be interfering with keyboard shortcuts, as it is a global shortcut listener like AltTab.

I can't reproduce the issue by doing the steps you do on the video, so I think it's something unique to your setup. I listed above some of the elements I've seen users have issues with. You may want to look into it. I would recommend you try to close as many apps as you can, use an internal keyboard, etc. To try and remove as many factors as you can. I'll close this ticket as it is unactionable for now. If you have new data, feel free to share it here, and we can re-open the ticket if there is something that can be done.

keman5 commented 1 year ago

I found the problem. When I use Preferences - Desktop & Dock - 'Stage Manager', cmd + ` will be invalid. It's only can find when enable the new Feature.

lwouis commented 1 year ago

Thank you for sharing this! I was able to reproduce the issue with Stage Manager on.

It's very interesting. I tested with Stage Manager on and off. You can see in the menubar, under Window, that Cycle through Windows is always present (with Stage Manager on or off):

image

But the behavior is different, depending on if it's activated or not:

Another difference is the interaction with AltTab, if AltTab is also set to use command+`:

So there is both a new, undocumented behavior for this shortcut, when Stage Manager is on, as well as a new shortcut priority when it's on, that messes with AltTab.

We already use a private API to disable the native command+tab for people who want to use command instead of alt for AltTab, to avoid the native switcher to appear in addition to AltTab. I'll check if it's maybe possible to also disable command+` in the same fashion (only on macOS 13 since it wasn't necessary before Stage Manager).

All of what I wrote above is when you activate AltTab with command+`, but your original issue is to set ` to cycle backwards. I was able to reproduce the issue as well. It's probably due to the OS absorbing the shortcut, and AltTab not receiving it.

Again, I'll look into disabling this native shortcut, if AltTab is open, just like we do for command+tab and command+shift+tab already (only when AltTab is open, and if the user has set AltTab to these native shortcut keys).

lwouis commented 1 year ago

I implemented the workaround for this, as I described above. I'll release a new version of AltTab with this soon 👍

keman5 commented 1 year ago

👏 Awesome! ohhhhhh!!!!! 👏 Thanks a lot!

AfzalivE commented 1 year ago

I'm still seeing this bug on 6.49.0 with these settings.

Shortcut 1 Shortcut 2
Screenshot 2022-11-09 at 4 43 17 PM Screenshot 2022-11-09 at 4 43 06 PM
lwouis commented 1 year ago

@AfzalivE could you please share a video, steps to reproduce, version of macOS, etc?

AfzalivE commented 1 year ago

https://user-images.githubusercontent.com/436057/200972993-da87ed03-b446-45b9-a502-4dd6794f5176.mp4

MacOS 13.0

Steps:

  1. Set shortcut 2 (show active app windows) to cmd + `, just like the macOS shortcut to switch between active app's windows.
  2. Open two windows of an app, make sure stage manager is enabled
  3. Switch to one of the windows of the app, then try to switch to another using cmd + `

Expected: The other window of the active app becomes active.

Actual: The other window shows up while the switcher is showing but as soon as the button is released, it switches back to the original window.

This doesn't happen if the shortcut is anything else btw.

lwouis commented 1 year ago

Thank you for sharing this report @AfzalivE. I'm so confused as to what happened here. I was convinced the issue got fixed (see exchanges above). Somehow there is still an issue. I mean the issue is pretty clear, AltTab is failing to disable the native OS behavior, so it happens at the same time as AltTab is trying to do its job.

I'll look into it

ravipinto commented 1 year ago

@lwouis - is there any update on this issue? I am facing the same issue on Ventura (13.4)