Add support for alt-backtick switching#377
Conversation
|
Would someone be able to check if this can be merged? Not having this functionality anymore (compared to before Cosmic) really slows you down when working with multiple windows of the same application. At the moment the only real 'solution' is to put windows next to each other, or go via the previews in the menu bar. |
|
@wash2 @jackpot51 @weblate @mmstick can someone please take a look? |
|
It's currently a draft. When the author is ready for reviews, it should be marked ready for review. |
Ok, I'll mark this as "ready for review". Like I mentioned in pop-os/cosmic-epoch#2125 (comment) , I'm not generally a contributor to cosmic-desktop and I'm not sure if this is mergeable as-is (or what the conventions are for mergeable code in this project). I just want this feature in an official release myself and this code seemed like it worked on my system. I'd be happy if anyone at all who is more familiar with contributing to this project took this code and ran with it, I don't care if my name is on the git commit or not, I just want Alt-backtick to work in cosmic. |
|
It looks like this is failing to build on our build server. When I try building it myself on a system I get these errors: |
|
|
||
| self.alt_backtick = Some(String::new()); | ||
| self.request(launcher::Request::Search(String::new())); | ||
| self.queue.push_back(Message::ShiftAltBacktick); |
There was a problem hiding this comment.
| self.queue.push_back(Message::ShiftAltBacktick); | |
| self.queue.push_back(Message::ShiftAltBacktick); | |
| } |
| IconSource::Name(name) | IconSource::Mime(name) => name, | ||
| }; | ||
| button_content.push( | ||
| icon(from_name(name.clone()).into()) |
There was a problem hiding this comment.
| icon(from_name(name.clone()).into()) | |
| icon(icon::from_name(name.clone()).into()) |
There was a problem hiding this comment.
due to imports we need this. Other option is to import from_name from icon
| }))) | ||
| .into(), | ||
| ); | ||
| } |
| return iced_runtime::task::widget(operation::scrollable::snap_to( | ||
| SCROLLABLE.clone(), | ||
| RelativeOffset { | ||
| x: 0., |
| SCROLLABLE.clone(), | ||
| RelativeOffset { | ||
| x: 0., | ||
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) |
There was a problem hiding this comment.
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) | |
| y: Some((self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) |
There was a problem hiding this comment.
Seems like Option<f32> is needed here after all
| RelativeOffset { | ||
| x: 0., | ||
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) | ||
| .max(0.0), |
There was a problem hiding this comment.
| .max(0.0), | |
| .max(0.0)), |
| return iced_runtime::task::widget(operation::scrollable::snap_to( | ||
| SCROLLABLE.clone(), | ||
| RelativeOffset { | ||
| x: 0., |
| SCROLLABLE.clone(), | ||
| RelativeOffset { | ||
| x: 0., | ||
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) |
There was a problem hiding this comment.
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) | |
| y: Some((self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) |
| RelativeOffset { | ||
| x: 0., | ||
| y: (self.focused as f32 / (self.launcher_items.len() as f32 - 1.).max(1.)) | ||
| .max(0.0), |
There was a problem hiding this comment.
| .max(0.0), | |
| .max(0.0)), |
|
Added suggestions to fix the code. Based on my work with Opus 4.5 and running a bunch of tests with cargo build. Take it or leave it :) |
|
But also awesome work on this initiative. Just chiming in as I really miss this feature too <3 |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as low quality.
This comment was marked as low quality.
|
I'm not seeing alt+backtick do anything with this change. Is this still a WIP? |
After this PR it still requires adding the shortcut in settings that uses the added argument. I guess it could be added as a default shortcut after merging though? |
|
Ah I didn't realize it had to be set up manually. I assume I have to add something to |
Ya, I just added a custom shortcut in cosmic-settings.
|
leviport
left a comment
There was a problem hiding this comment.
Got it, seems to be working nicely after adding the custom shortcut.
Looks like there are some merge conflicts, so I can re-approve once those are fixed.
Add support for alt-backtick and alt-shift-backtick to switch between windows of the same application.