-
-
Notifications
You must be signed in to change notification settings - Fork 343
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
After opening AltTab, it seems like the Next Window shortcut is held or pressed a few times without the user doing anything #3117
Comments
I experience the same issue with the same environment. I reverted to 6.63.0 and the weird behavior is gone. I suspect this is related to this commit. |
Thank you @warrenseine for sharing this message. @SamadiPour does v6.63.0 also fix the issue for you? I don't see how the issue would be related to the commit though. @SamadiPour on your video, I see some flickering on the right part of AltTab's window. I'm wondering if you are not suffering from #1840. Could you please show the top menubar of your screen, when the issue happens? If there are 2 AltTab icons, that's the source of the issue right there. |
@lwouis Just tried v6.63.0, and it seems like I can't see the issue anymore. I will test more to make sure. Also, flickering might be because of video compression or the recorder. I didn't see any flicker while using it. I also checked the processes and top menubar, and there was only one instance running. |
Update: I have not experienced the issue since downgrading to v6.63.0. |
I can confirm that this happens to me as well. I am on the app version 6.64.0. I am on the latest macOS Sonoma version 14.2.1 |
the same problem |
I had this problem on Sonoma 14.2, it does not seem to happen after upgrade to 14.3. Running alttab 6.64.0 on both versions. |
The same here |
Same here; it's getting annoying, but I don't want to just throw the issue to maintainers. I'll be happy to contribute if any core maintainer could give me the issue! |
@ankushagarwal from your video, I wonder if this issue is related in any way to the mouse. Can you reproduce the issue without moving the mouse at all, with the mouse outside the AltTab UI? Same question for @SamadiPour: can you reproduce the issue without having the mouse hover AltTab? It looks to me like it could be about key repeats, and maybe external keyboards or software keyboard remappers. |
I do use BetterTouchTool, but only to bind shortcuts. I use the trackpad and generally don't touch it while alt-tabbing. But it's possible that the cursor is on top of one of the window tile when I alt-tab. I'll monitor. Also, I'd like to re-iterate that it's very much likely a regression in 6.64. I reverted to 6.63 and didn't have the issue for a week, then I accidently auto-updated back to 0.64 and the bug started again. I re-installed 6.63 once more. |
I'm suspecting that it is not a regression introduced in v6.64. I suspect it because the only code change that could potentially impact is 3b0194d, and I can't imagine how it would interact with the use-case here. I may be missing it, but I could also be guessing right, in which case the issue is not about AltTab, but about something with your environments. Many people have thought AltTab was bugged, and later realized that the root cause was their external keyboard, software remapper, rare keyboard layout, key repeat settings, etc. In the case that the issue would be a regression from AltTab, it would be important to establish if indeed the mouse position or movement is involved, or if it's purely a keyboard event issue. The code change only deals with keyboard events, which is why I'm suspecting that the mouse may not have anything to do with the behaviors we see on the various videos. |
I experience the same. Noticed strange thing about the app switcher window - when there are two apps (Slack and Mictosoft Teams in my case) and the mouse cursor is somewhere around the switcher area, after I pressed app switch combination the switcher window remains on the screen. Having hard time reproducing it yet but it is definitely the thing. Have caught it many times so far. I believe it is relevant to the topic. |
Can confirm that I was experiencing the same issue on 6.65.0 and reverting back to 6.63.0 fixed it. Whenever I would move my mouse when using AltTab, the selection window would spaz out and be completely unusable until after restarting the app. Similar issue that was closed here #3168 |
Same problem here. I couldn't switch windows using alt+tab whenever the mouse was over the switcher UI, even if I did not move the pointer, the switching would glitch out and wouldn't work. To make it work I have to move the cursor away from the center (to be specific, outside the switcher overlay) and then alt-tab would work fine. Reverted to v6.63.0, it's working fine now. |
I've been trying 6.63.0 for a couple days and thought it was fixed but apparently it technically isn't, I still get the option drifting but way less often than with latest version. |
Yes, same here. I've reported that it was ok in 6.63.0, but after a few days / weeks, I've noticed the behaviour too. |
It looks like my hypothesis was right then. The issue is either with some external factor like third-party hardware or software, or it's an AltTab issue with has been here for a while, before v6.63.0. |
I degraded to I also wanted to share the video of what I was seeing. So I recorded my screen with the degraded version Regarding external factors, I use BetterTouchTool (to map gesture on trackpad to open a link in a new tab) and I do use an external bluetooth keyboard. So maybe it could be related to something external, 🤷♂️. |
Can anyone reproduce the issue without having the mouse hover the UI? I would like to understand if the issue is related to the mouse hovering the UI, or not. |
I have also experienced something similar to this problem randomly through months (maybe years), but not with 6.65.0. I have a gut feeling that it might have something to do with cpu load, but I cannot reproduce it. |
The bug is very intermittent for me but I got a related (not quite identical) occurrence on my self-built binary with logging: @discardableResult
fileprivate func handleEvent(_ id: EventHotKeyID?, _ shortcutState: ShortcutState?, _ keyCode: UInt32?, _ modifiers: UInt32?, _ isARepeat: Bool) -> Bool {
debugPrint("handleEvent", id ?? "nil", shortcutState ?? "nil", keyCode ?? "nil", modifiers ?? "nil", isARepeat); This printed:
This implies that the app saw the Cmd keypress released before the Tab keypress was registered, yet it still brought up the AltTab UI. It never closed because the Cmd keypress never got released after the UI opened. (In this case I didn't get an endless Tab key repeat alongside the stuck-open Cmd keypress. I want to take a log of that too when it happens.) For context,
To me this is a clear race condition in event handling. (Unfortunately, like many race conditions I'm unable to reproduce it easily.)
How should we address the bug?
(Sidenote: apparently I still don't know the cause of the other bug behavior where positioning the mouse where the AltTab popup would spawn, would make it not close. I have not replicated that issue with logging yet. |
Got a different issue where the Alt+Tab menu didn't close for like 2 seconds after releasing Cmd.
|
This also worked for me. System settings -> Privacy & Accessibility -> Accessibility -> Switch AltTab off and back on. |
Same, perhaps the original issue should be updated with the workarounds. Would save folks some time. |
I've found a semi-reliable way to reproduce a version of this issue:
At this point you'll get event logs like:
This indicates:
Because the popup is opened (Cmd-Tab) after the event to close the menu (!Cmd) is received, the menu never closes. What caused the original bug?I think the initial bug report (where "alt-tab" appears held for a second or so) is a variant where when the mouse sits above the popup while it opens, the Tab release event is delayed, and the app sees it as Alt-Tab being held for a second even if the user quickly released it. I don't know what causes "mouse sitting over Alt-Tab" to trigger shortcut processing delays on some machines sometimes, but removing AltTab from accessibility options temporarily fixes it It's possible that (in my reproducer) the lag happens because of my logging code sending data into the XCode output log; the bug becomes harder to reproduce (I have to Alt-Tab much faster to trigger the ordering error) after clearing the log. Nonetheless the core event ordering bug is an underlying Apple footgun/bug (I don't know if they promise in-order event delivery), and the effects are consistent with behaviors I and others in this thread have observed. In particular, cycling a few windows is only explainable by |
Hi everyone, Could you please test this local build? I made the shortcut handling code more loose. It may help be more robust and close even when events arrive in the wrong order from the OS. I hope it doesn't cause regressions, so please share if you see any weird behavior. Thank you everyone to help test this one out 🙇 Thank you @nyanpasu64 for your great analysis. Thank you for helping see this issue resolved. It's a tough one as it seems to happen only for some people and in some cases. It's probably the OS being busy in specific ways, resulting in the issue. |
The build causes a new(?) problem where when I Cmd-Tab (I rebound from Alt-Tab) to an app, then press and release Cmd, it switches to the app I most recently cmd-tabbed to. |
@nyanpasu64 thank you for testing it 🙇 I wasn't able to reproduce the issue you mention. Could you please share the sequence of inputs you did? For example:
|
|
I was able to reproduce with these steps. Thank you! |
If I map the sequence from your logs, I see that it not in order indeed: cmd down What AltTab does for keyboard input is listen to 3 different API callbacks:
It never occured to me before that these 3 sources could come send events in a different order than the one that happened on the actual keyboard. Now that I think about it, it's totally possible. These callbacks may be coming from different macOS subsystems, or uses different event queues, or receive different loads at different time. You may think that we have a complex implementation. Why not use one source of events? That's because we support quite complex use-cases:
To support that, we have the current complex setup with 3 distinct sources of events. I'm not sure if there is a way for us to support out-of-order events. If anyone wants to help, here's where event handling happens. Thank you |
The worst thing is that the original bug report (alt-tab acts held) seems more like a delayed tab release (hotkey), than an event reordering (which can result from delays). So there's nothing you can do in your app to detect and compensate for that issue. At this point I want to debug the actual library code that sends hotkeys to the app (eg. breakpointing AltTab and looking at parent stack frames), but I'm not planning on that yet. |
Perhaps I'm misunderstanding, but would it not be possible to just listen for modifier events from i.e. you would check in which case the flow would look something like this: cmd down |
|
Hi, Could you please test this local build? It may just be robust enough to handle some out-of-order cases. It doesn't have the issue of the previous local build. Could you guys please try it out of a while and see if it fixes the issue for you? Thank you 🙇 /cc @unodgs @dottedmag @jordantrizz @AlexeyKupershtokh @warrenseine @ankushagarwal @nyanpasu64 @maximvl @problame @EskelCz @AlabasterAxe @evanhammer @saitonakamura @samuelhwilliams @jebeaudet @letalumil @Joeyn1993 @RecuencoJones @xdanik |
No issues so far, though the bug is intermittent so it's hard to say it's fixed. I noticed that after pressing alt-tab, there's a few hundred ms delay before the popup appears? Probably harmless, possibly intentional, I think KDE delays the alt-tab menu appearing so quick presses won't flicker the screen, though the downside is you have to wait a bit before you can start scanning the list of window titles to look for one you want. |
@nyanpasu64 AltTab does exactly what you described, to avoid flickering. You can remove that delay or adjust it in |
# [7.3.0](v7.2.0...v7.3.0) (2024-11-10) ### Bug Fixes * better handle screen or space changes (closes [#1254](#1254), closes [#2983](#2983)) ([3c4aaf5](3c4aaf5)) * potential issues with key repeats due to concurrency ([4cfe16a](4cfe16a)) * switcher would not close, or cycle on its own (closes [#3117](#3117)) ([d430f83](d430f83)) * works without screen-recording permissions (closes [#3819](#3819)) ([f7de2bb](f7de2bb)) ### Features * can pass the --logs= flags at launch to show logs ([81eb07e](81eb07e)) * improve el, fi, hi, it, pl, pt localizations ([a9614c1](a9614c1))
@lwouis works like a charm so far! Thanks so much for fixing it!! |
I'm also testing and I haven't encountered the bug. |
On the test build, I got a stuck-open Alt-Tab window when pressing the shortcut when exiting fullscreen in a Bluesky video in Firefox (https://bsky.app/profile/ashleylynch.bsky.social/post/3lbfuhxufsc2x). I cannot reproduce this issue on demand. So it seems not 100% fixed, but I don't know what's going on in this build. Maybe I should update to the latest program release (which supersedes the build?). |
The new build is an improvement (Alt-Tab is no longer stuck open) but sometimes it takes from a few seconds to half a minute after a single Alt-Tab press (not holding either key, just a quick switch to the previous app) for the action to happen. By the time I'll have switched manually using Dock or other shortcuts so I'll be switched back to another random window (correctly, but not what I wanted anymore). |
@koterpillar how often does it happen? Can you reproduce it consistently, like within a few minutes? Is your machine under heavy load or normal load? Do you use Karabineer, BTT, or other keyboard remappers? Do you use the laptop keyboard or an external one? Which keyboard layout do you use (physical and software via Input Source)? Thank you |
Happens occasionally, seems to happen more when on battery power. When it happens it happens often. The machine is under no particularly heavy load, but the baseline is VS Code (plus language servers), browser, terminal, Slack. I use Karabiner, no other remappers. This happened on the internal laptop keyboard, can't recall if also on external. US English keyboard, |
Thank you @koterpillar. Karabiner could be messing with the inputs. Could you try and confirm if the issue happens with Karabiner not running? |
Describe the bug
Since a few weeks ago, I have been experiencing drifting when the mouse is hovered over an item. It only happens when the mouse is over an item, and not when it's inside or outside of the frame.
When I hold down the
Command
key and pressTab
once (push and release instantly), the selector drifts through the items, sometimes until it reaches the mouse and sometimes until it reaches the end.The
Mouse hover
option underAlso select windows using
is disabled.Screenshots / video
Screenshot.2024-01-19-jK5O4SMZ1.mp4
Steps to reproduce the bug
Your environment
The text was updated successfully, but these errors were encountered: