-
Notifications
You must be signed in to change notification settings - Fork 48
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: alt tab cycle #227
base: master
Are you sure you want to change the base?
feat: alt tab cycle #227
Conversation
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.
This is doing something, but the behavior seems like it needs to be tweaked a little.
- Alt/super+tab recency-based cycling cosmic-launcher#135 specifies pressing/releasing Alt-Tab should switch back and forth between the two most recent windows. I'm seeing that work sporadically, but usually, the currently selected window shows up first in the list, so pressing/releasing Alt-Tab doesn't change the window at all.
- I'm seeing one window (titled
Oracle VM VirtualBox Manager
) basically stuck at the second or third position even after switching between many other windows (from Firefox and COSMIC Terminal) and not touching that one. So it seems like the recency-based sorting isn't working quite right, or there's somehow a way for another app/window to bypass it.
Reading pop-os/cosmic-launcher#135, I do see it specifies applications and not windows. Let me know if we need to get UX clarification on that, if it's supposed to be working with applications right now. I think issue 1 is independent of that, based on the behavior. |
Just to be sure, did you test with pop-os/cosmic-launcher#150 ? With this PR, alt+tab will select the second app. I was able to reproduce 2. |
Ah, no I didn't. I'll get that built on CI for testing. |
I think it require launcher to be located in ../launcher currently. I will change that once i fix point 2 |
I think there is a bug in cosmic-comp that make this PR not working: code for the log: ToplevelEvent::Update(handle, info) => {
warn!("Update {}: {:?}", &info.app_id, &info.state); Output when selecting konsole -> cosmic-edit -> virtualbox -> firefox (using cosmic-launcher)
I'm not sure this protocol is intended for this use case tho cc @Drakulix |
86a54d5
to
ff67636
Compare
3ef67bd
to
ff67636
Compare
ff67636
to
340a1c2
Compare
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.
This seems to be working pretty well now.
The recency is not taking into account window activations that are a result of switching workspaces. This causes a couple of issues:
In this first video, the OBS window is never suggested as the second-most-recent window, even when I go from it directly to another window (by switching workspaces).
2024-09-24.18-15-52.mp4
In this second video, even when I select a second window on that second workspace, alt-tab brings me back to the first workspace, instead of back to the previously-selected OBS window.
2024-09-24.18-21-25.mp4
I think the only thing that needs to change is for the recency to take into account window activations caused by workspace switching. (Alternatively, switching could be isolated per-workspace to avoid this issue, but I don't think that was the intended design.)
probably a cosmic-comp issue @Drakulix |
No it isn't. The current workspace doesn't affect the |
How would i know which top_level is active just by knowing witch workspace was activated ? Let's says there are multiple windows in workspace B. And also the case where all windows in workspace B are minimized, i guess we don't want to bump any top_level in the list. |
The one with the |
I try to implement it in this branch https://github.com/wiiznokes/launcher/tree/alt-tab-with-workspace-support-1. |
I am sorry, but I am not going to debug your branch and you are not providing me with a bunch of information. |
Ok, sorry about that. I figured out the bug in my code that was causing no sense (using
result: The list will be C -> A -> B instead of C -> B -> A, because both Edit: And |
From a cosmic-comp perspective we first swap workspaces and fixup focus afterwards, which... yeah.. I get how this is a hassle. From a protocol perspective it is quite difficult to guarantee any specific order between the two protocols. It might be easier to remove the |
But in my example, if the app A get focused instead of C, cosmic-toplevel will not be trigger. |
@Drakulix Just to be sure, do you agree that cosmic-comp need to re send the |
Yes. Though this would also mean we remove the |
I don't think so. I think is it will better overall this way |
Great. I think this should fix it: pop-os/cosmic-comp#889 |
Old PR #225
impl pop-os/cosmic-launcher#135
With this PR, the service is not intended to be restarted everytime the cosmic-launcher is shown, because the toplevel plugin needs to keep track of some states.
So i just added a field in the plugin config:
For plugins that need to always running.
And this variant Frontend -> Service/Plugin
I believe the service was written with this usecase in mind, so there isn't much change.
Also, i had to deactivate the sort when the query is empty.