forked from iced-rs/iced
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sctk): support ShowWindowMenu feat(sctk): support for overflow widget sctk: Fixes for cursor icon * With multiple windows, `SetCursor` is only sent for the focused window. Fixing a flicker between icons when two windows are using different cursors. * If there is a drag surface, let that surface set the cursor. And not any other. * Set cursor on `enter`, and when switching between CSDs and app area. Fixes pop-os/libcosmic#533. improv(sctk): per-surface cursor position tracking
- Loading branch information
Showing
9 changed files
with
233 additions
and
160 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
Oops, something went wrong.