forked from iced-rs/iced
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
127 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,34 @@ | ||
#![allow(missing_docs)] | ||
|
||
use sctk::reexports::csd_frame::{WindowManagerCapabilities, WindowState}; | ||
use sctk::{ | ||
reexports::csd_frame::{WindowManagerCapabilities, WindowState}, | ||
shell::xdg::window::WindowConfigure, | ||
}; | ||
|
||
/// window events | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
#[derive(Debug, Clone)] | ||
pub enum WindowEvent { | ||
/// window manager capabilities | ||
/// Window manager capabilities. | ||
WmCapabilities(WindowManagerCapabilities), | ||
/// window state | ||
/// Window state. | ||
State(WindowState), | ||
/// Window configure event. | ||
Configure(WindowConfigure), | ||
} | ||
|
||
impl PartialEq for WindowEvent { | ||
fn eq(&self, other: &Self) -> bool { | ||
match (self, other) { | ||
(Self::WmCapabilities(a), Self::WmCapabilities(b)) => a == b, | ||
(Self::State(a), Self::State(b)) => a == b, | ||
(Self::Configure(a), Self::Configure(b)) => { | ||
a.capabilities == b.capabilities | ||
&& a.state == b.state | ||
&& a.decoration_mode == b.decoration_mode | ||
&& a.new_size == b.new_size | ||
&& a.suggested_bounds == b.suggested_bounds | ||
} | ||
_ => false, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters