Merge pull request #804 from pop-os/fix-desktop-active-tab
fix: set the active tab in desktop mode when the window is focused
This commit is contained in:
commit
f63b0f097b
1 changed files with 13 additions and 0 deletions
13
src/app.rs
13
src/app.rs
|
|
@ -286,6 +286,8 @@ pub enum Message {
|
||||||
DialogUpdate(DialogPage),
|
DialogUpdate(DialogPage),
|
||||||
DialogUpdateComplete(DialogPage),
|
DialogUpdateComplete(DialogPage),
|
||||||
ExtractHere(Option<Entity>),
|
ExtractHere(Option<Entity>),
|
||||||
|
#[cfg(all(feature = "desktop", feature = "wayland"))]
|
||||||
|
Focused(window::Id),
|
||||||
Key(Modifiers, Key),
|
Key(Modifiers, Key),
|
||||||
LaunchUrl(String),
|
LaunchUrl(String),
|
||||||
MaybeExit,
|
MaybeExit,
|
||||||
|
|
@ -3516,6 +3518,15 @@ impl Application for App {
|
||||||
self.size = Some(size);
|
self.size = Some(size);
|
||||||
self.handle_overlap();
|
self.handle_overlap();
|
||||||
}
|
}
|
||||||
|
#[cfg(all(feature = "desktop", feature = "wayland"))]
|
||||||
|
Message::Focused(id) => {
|
||||||
|
if let Some(w) = self.windows.get(&id) {
|
||||||
|
match w {
|
||||||
|
WindowKind::Desktop(entity) => self.tab_model.activate(*entity),
|
||||||
|
_ => {}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Task::none()
|
Task::none()
|
||||||
|
|
@ -4506,6 +4517,8 @@ impl Application for App {
|
||||||
Some(Message::Modifiers(modifiers))
|
Some(Message::Modifiers(modifiers))
|
||||||
}
|
}
|
||||||
Event::Window(WindowEvent::Unfocused) => Some(Message::WindowUnfocus),
|
Event::Window(WindowEvent::Unfocused) => Some(Message::WindowUnfocus),
|
||||||
|
#[cfg(all(feature = "desktop", feature = "wayland"))]
|
||||||
|
Event::Window(WindowEvent::Focused) => Some(Message::Focused(window_id)),
|
||||||
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
|
Event::Window(WindowEvent::CloseRequested) => Some(Message::WindowClose),
|
||||||
Event::Window(WindowEvent::Opened { position: _, size }) => {
|
Event::Window(WindowEvent::Opened { position: _, size }) => {
|
||||||
Some(Message::Size(size))
|
Some(Message::Size(size))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue