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.
fix: quad rendering including border only inside of the bounds fix: better slider drawing (it allows just the border part of the handle quad outside of the layout bouds, which isn't great, but is ok for our purposes due to being transparent) cleanup: fix & format fix: use iced_core::Font cleanup fix: allow leaving out winit & iced-sctk fix: settings fix: slider draw improvements fix: websocket example fix: modal example fix: scrollable example fix: toast example fix: avoid panicking in iced_sctk with lazy widgets in auto-size surfaces fix: todos panic fix: only diff auto-sized surfaces in iced_sctk build_user_interface & improve sctk examples wip (iced-sctk): window resize with icons feat (iced-sctk): support for setting cursor refactor: default decorations to client fix: set window geometry after receiving configure fix: size limits with no max bound must be cut off fix: send size update when autosized surface resizes fix: use ceil size for positioner cleanup: remove dbg statement fix: remove a destroyed surface from compositor surfaces fix errors after rebase and wip scaling support fix: handling of scale factor in set_logical_size fix (sctk_drag example): add .into for border radius fix: fractional scaling sctk: Fire RedrawRequests wip: animations via frame event fix / refactor iced-sctk redraw & frame event handling cleanup: note about frame request in iced-sctk fix: send resize when necessary for layer surface and popups too fix: always request redraw for a new surface fix: scaling and autosize surface improvements refactor: sctk_lazy keyboard interactivity feat(sctk): configurable natural_scroll property feat: send state and capabilities events when there are changes fix: redraw when an update is needed and clean up the logic Update sctk to latest commit Fix compilation of sctk drag example fix(sctk): update interface before checking if it has a redraw request refactor: after autosize surface resize wait to redraw until the resize has been applied refactor: better handling of autosize surfaces chore: update sctk chore: update sctk fixes sctk_drag example fix: default to ControlFlow::Wait for applications with no surface this seems to help CPU usage for app library and launcher default to 250ms timeout in the event loop Update sctk sctk: Implement xdg-activation support fix: don't require Flags to be clone for settings on wayland chore: error if neither winit or wayland feature is set chore: Allow compiling without windowing system (#65) fix(iced-sctk): handle exit_on_close_request fix: make sure that each widget operation operates on every interface This should be ok even for widget actions like focus next because there can only ever be a single focused widget cargo fmt cleanup: dbg statement fix(iced-sctk): replace panic with handling for remaining enum variants refactor: use iced clipboard for interacting with the selection refactor: allow passing an activation token when creating a window sctk: Add support for `ext-session-lock` protocol fix(sctk): build and use tree for layout of autosize surfaces Update winit to latest commit used by upstream iced
- Loading branch information
Showing
119 changed files
with
13,947 additions
and
251 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
use sctk::{ | ||
data_device_manager::{data_offer::DragOffer, ReadPipe}, | ||
reexports::client::protocol::wl_data_device_manager::DndAction, | ||
}; | ||
use std::{ | ||
os::fd::{AsRawFd, OwnedFd, RawFd}, | ||
sync::{Arc, Mutex}, | ||
}; | ||
|
||
/// Dnd Offer events | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub enum DndOfferEvent { | ||
/// A DnD offer has been introduced with the given mime types. | ||
Enter { | ||
/// x coordinate of the offer | ||
x: f64, | ||
/// y coordinate of the offer | ||
y: f64, | ||
/// The offered mime types | ||
mime_types: Vec<String>, | ||
}, | ||
/// The DnD device has left. | ||
Leave, | ||
/// Drag and Drop Motion event. | ||
Motion { | ||
/// x coordinate of the pointer | ||
x: f64, | ||
/// y coordinate of the pointer | ||
y: f64, | ||
}, | ||
/// The selected DnD action | ||
SelectedAction(DndAction), | ||
/// The offered actions for the current DnD offer | ||
SourceActions(DndAction), | ||
/// Dnd Drop event | ||
DropPerformed, | ||
/// Raw DnD Data | ||
DndData { | ||
/// The data | ||
data: Vec<u8>, | ||
/// The mime type of the data | ||
mime_type: String, | ||
}, | ||
/// Raw Selection Data | ||
SelectionData { | ||
/// The data | ||
data: Vec<u8>, | ||
/// The mime type of the data | ||
mime_type: String, | ||
}, | ||
/// Selection Offer | ||
/// a selection offer has been introduced with the given mime types. | ||
SelectionOffer(Vec<String>), | ||
} | ||
|
||
/// Selection Offer events | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub enum SelectionOfferEvent { | ||
/// a selection offer has been introduced with the given mime types. | ||
Offer(Vec<String>), | ||
/// Read the Selection data | ||
Data { | ||
/// The mime type that the selection should be converted to. | ||
mime_type: String, | ||
/// The data | ||
data: Vec<u8>, | ||
}, | ||
} | ||
|
||
/// A ReadPipe and the mime type of the data. | ||
#[derive(Debug, Clone)] | ||
pub struct ReadData { | ||
/// mime type of the data | ||
pub mime_type: String, | ||
/// The pipe to read the data from | ||
pub fd: Arc<Mutex<ReadPipe>>, | ||
} | ||
|
||
impl ReadData { | ||
/// Create a new ReadData | ||
pub fn new(mime_type: String, fd: Arc<Mutex<ReadPipe>>) -> Self { | ||
Self { mime_type, fd } | ||
} | ||
} | ||
|
||
/// Data Source events | ||
/// Includes drag and drop events and clipboard events | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub enum DataSourceEvent { | ||
/// A Dnd action was selected by the compositor for your source. | ||
DndActionAccepted(DndAction), | ||
/// A mime type was accepted by a client for your source. | ||
MimeAccepted(Option<String>), | ||
/// Some client has requested the DnD data. | ||
/// This is used to send the data to the client. | ||
SendDndData(String), | ||
/// Some client has requested the selection data. | ||
/// This is used to send the data to the client. | ||
SendSelectionData(String), | ||
/// The data source has been cancelled and is no longer valid. | ||
/// This may be sent for multiple reasons | ||
Cancelled, | ||
/// Dnd Finished | ||
DndFinished, | ||
/// Dnd Drop event | ||
DndDropPerformed, | ||
} | ||
|
||
/// A WriteData and the mime type of the data to be written. | ||
#[derive(Debug, Clone)] | ||
pub struct WriteData { | ||
/// mime type of the data | ||
pub mime_type: String, | ||
/// The fd to write the data to | ||
pub fd: Arc<Mutex<OwnedFd>>, | ||
} | ||
|
||
impl WriteData { | ||
/// Create a new WriteData | ||
pub fn new(mime_type: String, fd: Arc<Mutex<OwnedFd>>) -> Self { | ||
Self { mime_type, fd } | ||
} | ||
} | ||
|
||
impl PartialEq for WriteData { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.fd.lock().unwrap().as_raw_fd() | ||
== other.fd.lock().unwrap().as_raw_fd() | ||
} | ||
} | ||
|
||
impl Eq for WriteData {} | ||
|
||
impl PartialEq for ReadData { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.fd.lock().unwrap().as_raw_fd() | ||
== other.fd.lock().unwrap().as_raw_fd() | ||
} | ||
} | ||
|
||
impl Eq for ReadData {} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/// layer surface events | ||
#[derive(Debug, Clone, PartialEq, Eq)] | ||
pub enum LayerEvent { | ||
/// layer surface Done | ||
Done, | ||
/// layer surface focused | ||
Focused, | ||
/// layer_surface unfocused | ||
Unfocused, | ||
} |
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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
mod data_device; | ||
mod layer; | ||
mod output; | ||
mod popup; | ||
mod seat; | ||
mod session_lock; | ||
mod window; | ||
|
||
use crate::{time::Instant, window::Id}; | ||
use sctk::reexports::client::protocol::{ | ||
wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface, | ||
}; | ||
|
||
pub use data_device::*; | ||
pub use layer::*; | ||
pub use output::*; | ||
pub use popup::*; | ||
pub use seat::*; | ||
pub use session_lock::*; | ||
pub use window::*; | ||
|
||
/// wayland events | ||
#[derive(Debug, Clone, PartialEq)] | ||
pub enum Event { | ||
/// layer surface event | ||
Layer(LayerEvent, WlSurface, Id), | ||
/// popup event | ||
Popup(PopupEvent, WlSurface, Id), | ||
/// output event | ||
Output(OutputEvent, WlOutput), | ||
/// window event | ||
Window(WindowEvent, WlSurface, Id), | ||
/// Seat Event | ||
Seat(SeatEvent, WlSeat), | ||
/// Data Device event | ||
DataSource(DataSourceEvent), | ||
/// Dnd Offer events | ||
DndOffer(DndOfferEvent), | ||
/// Selection Offer events | ||
SelectionOffer(SelectionOfferEvent), | ||
/// Session lock events | ||
SessionLock(SessionLockEvent), | ||
/// Frame events | ||
Frame(Instant, WlSurface, Id), | ||
} |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
use sctk::output::OutputInfo; | ||
|
||
/// output events | ||
#[derive(Debug, Clone)] | ||
pub enum OutputEvent { | ||
/// created output | ||
Created(Option<OutputInfo>), | ||
/// removed output | ||
Removed, | ||
/// Output Info | ||
InfoUpdate(OutputInfo), | ||
} | ||
|
||
impl Eq for OutputEvent {} | ||
|
||
impl PartialEq for OutputEvent { | ||
fn eq(&self, other: &Self) -> bool { | ||
match (self, other) { | ||
(Self::Created(l0), Self::Created(r0)) => { | ||
if let Some((l0, r0)) = l0.as_ref().zip(r0.as_ref()) { | ||
l0.id == r0.id && l0.make == r0.make && l0.model == r0.model | ||
} else { | ||
l0.is_none() && r0.is_none() | ||
} | ||
} | ||
(Self::InfoUpdate(l0), Self::InfoUpdate(r0)) => { | ||
l0.id == r0.id && l0.make == r0.make && l0.model == r0.model | ||
} | ||
_ => { | ||
core::mem::discriminant(self) == core::mem::discriminant(other) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.