fix: feature gates

This commit is contained in:
Ashley Wulber 2026-07-15 12:36:30 -04:00 • committed by Ashley Wulber
parent 511384f620
commit 8e6aea650a
23 changed files with 161 additions and 327 deletions

View file

@ -6,13 +6,7 @@ use std::sync::Arc;
use super::menu_bar::MenuBarState;
use super::menu_tree::MenuTree;
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "winit",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
use crate::app::cosmic::{WINDOWING_SYSTEM, WindowingSystem};
use crate::style::menu_bar::StyleSheet;
@ -677,13 +671,7 @@ impl<'b, Message: Clone + 'static> Menu<'b, Message> {
needs_reset |= self.close_condition.click_outside && !is_inside;
if needs_reset {
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "winit",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
&& let Some(handler) = self.on_surface_action.as_ref()
{
@ -990,13 +978,7 @@ impl<Message: std::clone::Clone + 'static> Widget<Message, crate::Theme, crate::
) {
let new_root = self.update(event, layout, cursor, renderer, clipboard, shell);
#[cfg(all(
feature = "multi-window",
feature = "wayland",
feature = "winit",
feature = "surface-message",
target_os = "linux"
))]
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland))
&& let Some((new_root, new_ms)) = new_root
{
@ -1271,13 +1253,7 @@ pub(crate) fn init_root_menu<Message: Clone>(
});
}
#[cfg(all(
feature = "multi-window",
feature = "wayland",
target_os = "linux",
feature = "winit",
feature = "surface-message"
))]
#[cfg(wayland_platform)]
pub(super) fn init_root_popup_menu<Message>(
menu: &mut Menu<'_, Message>,
renderer: &crate::Renderer,
@ -1572,7 +1548,7 @@ where
.as_ref()
.is_some_and(|i| *i != new_index && !active_menu[*i].children.is_empty());
#[cfg(all(feature = "multi-window", feature = "wayland",target_os = "linux", feature = "winit", feature = "surface-message"))]
#[cfg(wayland_platform)]
if matches!(WINDOWING_SYSTEM.get(), Some(WindowingSystem::Wayland)) && remove {
if let Some(id) = state.popup_id.remove(&menu.window_id) {
state.active_root.truncate(menu.depth + 1);