fix(app): closing of window in wayland
This commit is contained in:
parent
83fbde77ab
commit
56965ac2e5
3 changed files with 4 additions and 11 deletions
2
iced
2
iced
|
|
@ -1 +1 @@
|
||||||
Subproject commit 8195c7f50de6f07ea7475861f9be5139d3fa61e3
|
Subproject commit 55759e5bb79f84277ccf198f529af04184912874
|
||||||
|
|
@ -69,8 +69,6 @@ pub enum Message {
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub(crate) struct Cosmic<App> {
|
pub(crate) struct Cosmic<App> {
|
||||||
pub(crate) app: App,
|
pub(crate) app: App,
|
||||||
#[cfg(feature = "wayland")]
|
|
||||||
pub(crate) should_exit: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Application> IcedApplication for Cosmic<T>
|
impl<T: Application> IcedApplication for Cosmic<T>
|
||||||
|
|
@ -229,8 +227,7 @@ where
|
||||||
impl<T: Application> Cosmic<T> {
|
impl<T: Application> Cosmic<T> {
|
||||||
#[cfg(feature = "wayland")]
|
#[cfg(feature = "wayland")]
|
||||||
pub fn close(&mut self) -> iced::Command<super::Message<T::Message>> {
|
pub fn close(&mut self) -> iced::Command<super::Message<T::Message>> {
|
||||||
self.should_exit = true;
|
iced_sctk::commands::window::close_window(window::Id::MAIN)
|
||||||
iced::Command::none()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "wayland"))]
|
#[cfg(not(feature = "wayland"))]
|
||||||
|
|
@ -395,10 +392,6 @@ impl<T: Application> Cosmic<T> {
|
||||||
|
|
||||||
impl<App: Application> Cosmic<App> {
|
impl<App: Application> Cosmic<App> {
|
||||||
pub fn new(app: App) -> Self {
|
pub fn new(app: App) -> Self {
|
||||||
Self {
|
Self { app }
|
||||||
app,
|
|
||||||
#[cfg(feature = "wayland")]
|
|
||||||
should_exit: false,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -469,7 +469,7 @@ where
|
||||||
|
|
||||||
/// Constructs views for other windows.
|
/// Constructs views for other windows.
|
||||||
fn view_window(&self, id: window::Id) -> Element<Self::Message> {
|
fn view_window(&self, id: window::Id) -> Element<Self::Message> {
|
||||||
panic!("no view for window {:?}", id);
|
panic!("no view for window {id:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Overrides the default style for applications
|
/// Overrides the default style for applications
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue