From 15b748bf3ac203b1778a3d68671583a23c841837 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Wed, 19 Nov 2025 08:02:03 -0700 Subject: [PATCH] Fix compilation without wayland feature and add feature testing to CI --- .github/workflows/ci.yml | 2 ++ src/dialog.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 990edb0..80a6be4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/src/dialog.rs b/src/dialog.rs index 8ed71cc..6778c0c 100644 --- a/src/dialog.rs +++ b/src/dialog.rs @@ -369,6 +369,7 @@ impl Dialog { .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 Dialog { 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) }