Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Fix building with the accesskit feature on Linux (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
DJMcNab authored Jul 27, 2023
1 parent b47db9a commit 2421555
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:

- name: cargo build accesskit example
run: cargo build --features accesskit --example accesskit
if: contains(matrix.os, 'macos') || contains(matrix.os, 'windows')

# we test the wayland backend as a separate job
test-stable-wayland:
Expand Down
14 changes: 14 additions & 0 deletions src/backend/linux/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,20 @@ impl WindowHandle {
WindowHandle::None => panic!("Used an uninitialised WindowHandle"),
}
}

#[cfg(feature = "accesskit")]
pub fn update_accesskit_if_active(
&self,
update_factory: impl FnOnce() -> accesskit::TreeUpdate,
) {
match self {
#[cfg(feature = "x11")]
WindowHandle::X11(handle) => handle.update_accesskit_if_active(update_factory),
#[cfg(feature = "wayland")]
WindowHandle::Wayland(handle) => handle.update_accesskit_if_active(update_factory),
WindowHandle::None => panic!("Used an uninitialised WindowHandle"),
}
}
}

unsafe impl HasRawWindowHandle for WindowHandle {
Expand Down

0 comments on commit 2421555

Please sign in to comment.