fix(single-instance): unminimize main window on dbus activate
This commit is contained in:
parent
384e8f6e21
commit
a37be90e81
1 changed files with 21 additions and 8 deletions
|
|
@ -1034,15 +1034,28 @@ impl<T: Application> Cosmic<T> {
|
|||
}
|
||||
return Task::batch(cmds);
|
||||
}
|
||||
Action::Activate(_token) =>
|
||||
{
|
||||
#[cfg(feature = "wayland")]
|
||||
Action::Activate(_token) => {
|
||||
if let Some(id) = self.app.core().main_window_id() {
|
||||
return iced_winit::platform_specific::commands::activation::activate(
|
||||
// Unminimize window before requesting to activate it.
|
||||
let mut task = iced_runtime::window::minimize(id, false);
|
||||
|
||||
#[cfg(feature = "wayland")]
|
||||
{
|
||||
task = task.chain(
|
||||
iced_winit::platform_specific::commands::activation::activate(
|
||||
id,
|
||||
#[allow(clippy::used_underscore_binding)]
|
||||
_token,
|
||||
);
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "wayland"))]
|
||||
{
|
||||
task = task.chain(iced_runtime::window::gain_focus(id));
|
||||
}
|
||||
|
||||
return task;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue