Fix compilation without wayland feature and add feature testing to CI

This commit is contained in:
Jeremy Soller 2025-11-19 08:02:03 -07:00
parent 29a1f7f518
commit 15b748bf3a
No known key found for this signature in database
GPG key ID: 670FDFB5428E05CA
2 changed files with 4 additions and 0 deletions

View file

@ -17,4 +17,6 @@ jobs:
- uses: actions/checkout@v4
- run: sudo apt-get update; sudo apt-get install libclang-dev libglib2.0-dev libxkbcommon-dev
- run: rustup update stable && rustup default stable
- run: cargo test --verbose --no-default-features
- run: cargo test --verbose
- run: cargo test --verbose --all-features

View file

@ -369,6 +369,7 @@ impl<M: Send + 'static> Dialog<M> {
.map(DialogMessage)
.map(move |message| cosmic::action::app(mapper(message)));
if let Some(result) = self.cosmic.app.result_opt.take() {
#[cfg(feature = "wayland")]
if !self.cosmic.surface_views.is_empty() {
log::debug!("waiting for surfaces to close...");
let mut tasks = Vec::new();
@ -426,6 +427,7 @@ impl<M: Send + 'static> Dialog<M> {
self.cosmic.app.flags.window_id
}
#[cfg(feature = "wayland")]
pub fn contains_surface(&self, id: &window::Id) -> bool {
self.cosmic.surface_views.contains_key(id)
}