Skip to content

Commit

Permalink
On X11, extract event handlers
Browse files Browse the repository at this point in the history
Make code more clear wrt explicit returns during event handling,
which may lead to skipped IME event handling.
  • Loading branch information
kchibisov committed Feb 10, 2024
1 parent 9ad3ade commit d643b1a
Show file tree
Hide file tree
Showing 6 changed files with 1,375 additions and 1,324 deletions.
2 changes: 2 additions & 0 deletions src/platform_impl/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,10 +940,12 @@ impl EventLoopWindowTarget {
}
}

#[allow(dead_code)]
fn set_exit_code(&self, code: i32) {
x11_or_wayland!(match self; Self(evlp) => evlp.set_exit_code(code))
}

#[allow(dead_code)]
fn exit_code(&self) -> Option<i32> {
x11_or_wayland!(match self; Self(evlp) => evlp.exit_code())
}
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/linux/x11/atoms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ macro_rules! atom_manager {
($($name:ident $(:$lit:literal)?),*) => {
x11rb::atom_manager! {
/// The atoms used by `winit`
pub(crate) Atoms: AtomsCookie {
pub Atoms: AtomsCookie {
$($name $(:$lit)?,)*
}
}

/// Indices into the `Atoms` struct.
#[derive(Copy, Clone, Debug)]
#[allow(non_camel_case_types)]
pub(crate) enum AtomName {
pub enum AtomName {
$($name,)*
}

Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/x11/dnd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl From<io::Error> for DndDataParseError {
}
}

pub(crate) struct Dnd {
pub struct Dnd {
xconn: Arc<XConnection>,
// Populated by XdndEnter event handler
pub version: Option<c_long>,
Expand Down
Loading

0 comments on commit d643b1a

Please sign in to comment.