-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: Support --reverse
for alt-tab
#183
base: master
Are you sure you want to change the base?
Conversation
Also fixes behavior of `alt[-shift]-tab` not triggering the first time when the launcher activates. This seems to have been done intentionally, but this does not match any existing implementation of window/tab switching I know (e.g. Gnome, KDE, Windows, MacOS, Firefox, Chromium, VSCode, Zed, etc.) and IMO is very bad UX because triggering it once quickly will do nothing windows are sorted by last window focus.
The When installing it onto my system (the rest of the packages are the alpha1 version, not git) neither alt + tab nor alt + shift + tab function, I'm not sure why and it's very difficult to debug... |
I got it using my local version by specifying the exact directory to use by tacking That should make it easier to debug, so I'll see if I can figure out what the issue is. |
I have not yet figured out what part of this PR isn't working, but I have figured out why the code intentionally did not cycle the first time. The list is not relative to the application you are using. To explain what I mean, suppose you have three applications open, and we will call them Application 1, Application 2, etc. The list will always display Application 1, Application 2, and Application 3. So if you currently are focused on Application 1 and you quickly strike Alt-Tab and release, nothing will happen. If you are Application 2 and you strike Alt-Tab and release, you will switch to Application 1. Application 1 is always first. So this change just makes Alt-Tab always select Application 2 first. What we should really have is a list sorted by most recently focused and have Alt-Tab cycle to the next most recently focused on first press. That also lets you toggle between two tabs. |
I created the pull request needed for cosmic-settings: pop-os/cosmic-settings#675 Using my cosmic-settings, and your cosmic-settings-daemon, cosmic-comp, and cosmic-launcher is working as expected! |
if self.alt_tab { | ||
self.focus_next(); | ||
Message::AltTab { reverse } => { | ||
self.alt_tab = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on my comment in the conversations section, I think we should switch this back to not cycle when opened for now.
Once we have the applications ordered by most recently focused, we should make the change to cycle on the first use of Alt-Tab.
This sould be covered by #150 iirc |
Also fixes behavior of
alt[-shift]-tab
not triggering the first time when the launcher activates.This seems to have been done intentionally, but this does not match any existing implementation of window/tab switching I know (e.g. Gnome, KDE, Windows, MacOS, Firefox, Chromium, VSCode, Zed, etc.) and IMO is very bad UX because triggering it once quickly will do nothing windows are sorted by last window focus.
@git-f0x I worked on it some more and I think this is all that needs to be done on the
cosmic-launcher
side, but I haven't tried adding thealt-shift-tab
shortcut yet.Also, I ended up getting into a bit of a rabbit hole with debugging, to properly test the activation it has to run in cosmic-session, so I ended up symlinking it in-place of my system's
cosmic-launcher
, but then I had to resort to trying to write to a named pipe (which failed but I couldn't figure out why), and displaying it through the UI. Doescosmic-session
provide a way to view logs for components for the current session, or is there any better way to test?