diff --git a/Cargo.toml b/Cargo.toml index d9ddfb1..83fa353 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ default = ["libxdo"] libxdo = ["dep:libxdo"] common-controls-v6 = [] serde = ["dep:serde", "dpi/serde"] -ksni = ["arc-swap"] +linux-ksni = ["arc-swap"] [dependencies] arc-swap = { version = "1.7.1", optional = true } diff --git a/src/items/check.rs b/src/items/check.rs index dd64ced..c0d4517 100644 --- a/src/items/check.rs +++ b/src/items/check.rs @@ -4,10 +4,10 @@ use std::{cell::RefCell, mem, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId, MenuItemKind}; @@ -22,7 +22,7 @@ use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId pub struct CheckMenuItem { pub(crate) id: Rc, pub(crate) inner: Rc>, - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) compat: Arc>, } @@ -42,7 +42,7 @@ impl IsMenuItem for CheckMenuItem { } impl CheckMenuItem { - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_menu_item( item: &crate::platform_impl::MenuChild, ) -> crate::CompatMenuItem { @@ -73,13 +73,13 @@ impl CheckMenuItem { None, ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(inner.id().clone()), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -104,13 +104,13 @@ impl CheckMenuItem { Some(id.clone()), ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(id), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -132,10 +132,10 @@ impl CheckMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_text(text.as_ref()); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -149,10 +149,10 @@ impl CheckMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_enabled(enabled); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -171,10 +171,10 @@ impl CheckMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_checked(checked); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } diff --git a/src/items/icon.rs b/src/items/icon.rs index 43351b3..a9ae2c9 100644 --- a/src/items/icon.rs +++ b/src/items/icon.rs @@ -4,10 +4,10 @@ use std::{cell::RefCell, mem, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{ @@ -26,7 +26,7 @@ use crate::{ pub struct IconMenuItem { pub(crate) id: Rc, pub(crate) inner: Rc>, - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) compat: Arc>, } @@ -46,7 +46,7 @@ impl IsMenuItem for IconMenuItem { } impl IconMenuItem { - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_menu_item( item: &crate::platform_impl::MenuChild, ) -> crate::CompatMenuItem { @@ -81,13 +81,13 @@ impl IconMenuItem { None, ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(inner.id().clone()), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -112,13 +112,13 @@ impl IconMenuItem { Some(id.clone()), ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(id), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -144,13 +144,13 @@ impl IconMenuItem { None, ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(inner.id().clone()), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -178,13 +178,13 @@ impl IconMenuItem { Some(id.clone()), ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(id), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -206,10 +206,10 @@ impl IconMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_text(text.as_ref()); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -223,10 +223,10 @@ impl IconMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_enabled(enabled); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -245,10 +245,10 @@ impl IconMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_icon(icon); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } diff --git a/src/items/mod.rs b/src/items/mod.rs index 23a4d84..855d67c 100644 --- a/src/items/mod.rs +++ b/src/items/mod.rs @@ -8,7 +8,7 @@ mod normal; mod predefined; mod submenu; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] mod compat; pub use check::*; @@ -17,7 +17,7 @@ pub use normal::*; pub use predefined::*; pub use submenu::*; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub use compat::*; #[cfg(test)] diff --git a/src/items/normal.rs b/src/items/normal.rs index b584c3a..71e192f 100644 --- a/src/items/normal.rs +++ b/src/items/normal.rs @@ -1,9 +1,9 @@ use std::{cell::RefCell, mem, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId, MenuItemKind}; @@ -16,7 +16,7 @@ use crate::{accelerator::Accelerator, sealed::IsMenuItemBase, IsMenuItem, MenuId pub struct MenuItem { pub(crate) id: Rc, pub(crate) inner: Rc>, - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) compat: Arc>, } @@ -36,7 +36,7 @@ impl IsMenuItem for MenuItem { } impl MenuItem { - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_menu_item( item: &crate::platform_impl::MenuChild, ) -> crate::CompatMenuItem { @@ -57,13 +57,13 @@ impl MenuItem { pub fn new>(text: S, enabled: bool, accelerator: Option) -> Self { let inner = crate::platform_impl::MenuChild::new(text.as_ref(), enabled, accelerator, None); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(inner.id().clone()), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -86,13 +86,13 @@ impl MenuItem { Some(id.clone()), ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(id), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -114,10 +114,10 @@ impl MenuItem { let mut inner = self.inner.borrow_mut(); inner.set_text(text.as_ref()); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -131,10 +131,10 @@ impl MenuItem { let mut inner = self.inner.borrow_mut(); inner.set_enabled(enabled); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } diff --git a/src/items/predefined.rs b/src/items/predefined.rs index 2ac9a45..05ed7b0 100644 --- a/src/items/predefined.rs +++ b/src/items/predefined.rs @@ -4,10 +4,10 @@ use std::{cell::RefCell, mem, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{ @@ -22,7 +22,7 @@ use keyboard_types::{Code, Modifiers}; pub struct PredefinedMenuItem { pub(crate) id: Rc, pub(crate) inner: Rc>, - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) compat: Arc>, } @@ -42,7 +42,7 @@ impl IsMenuItem for PredefinedMenuItem { } impl PredefinedMenuItem { - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_menu_item( item: &crate::platform_impl::MenuChild, ) -> crate::CompatMenuItem { @@ -215,13 +215,13 @@ impl PredefinedMenuItem { text.map(|t| t.as_ref().to_string()), ); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&inner); Self { id: Rc::new(inner.id().clone()), inner: Rc::new(RefCell::new(inner)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -241,10 +241,10 @@ impl PredefinedMenuItem { let mut inner = self.inner.borrow_mut(); inner.set_text(text.as_ref()); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } diff --git a/src/items/submenu.rs b/src/items/submenu.rs index f0f8aa5..3b3fef6 100644 --- a/src/items/submenu.rs +++ b/src/items/submenu.rs @@ -4,10 +4,10 @@ use std::{cell::RefCell, mem, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{ @@ -22,7 +22,7 @@ use crate::{ pub struct Submenu { pub(crate) id: Rc, pub(crate) inner: Rc>, - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) compat: Arc>, } @@ -42,7 +42,7 @@ impl IsMenuItem for Submenu { } impl Submenu { - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_menu_item( item: &crate::platform_impl::MenuChild, ) -> crate::CompatMenuItem { @@ -61,13 +61,13 @@ impl Submenu { pub fn new>(text: S, enabled: bool) -> Self { let item = crate::platform_impl::MenuChild::new_submenu(text.as_ref(), enabled, None); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&item); Self { id: Rc::new(item.id().clone()), inner: Rc::new(RefCell::new(item)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -81,13 +81,13 @@ impl Submenu { let item = crate::platform_impl::MenuChild::new_submenu(text.as_ref(), enabled, Some(id.clone())); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] let compat = Self::compat_menu_item(&item); Self { id: Rc::new(id), inner: Rc::new(RefCell::new(item)), - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] compat: Arc::new(ArcSwap::from_pointee(compat)), } } @@ -125,10 +125,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.add_menu_item(item, AddOp::Append)?; - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); Ok(()) @@ -148,10 +148,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.add_menu_item(item, AddOp::Insert(0))?; - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); Ok(()) @@ -169,10 +169,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.add_menu_item(item, AddOp::Insert(position))?; - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); Ok(()) @@ -192,10 +192,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.remove(item)?; - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); Ok(()) @@ -230,10 +230,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.set_text(text.as_ref()); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -247,10 +247,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.set_enabled(enabled); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -263,10 +263,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.set_as_windows_menu_for_nsapp(); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -281,10 +281,10 @@ impl Submenu { let mut inner = self.inner.borrow_mut(); inner.set_as_help_menu_for_nsapp(); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] self.compat.store(Arc::new(Self::compat_menu_item(&inner))); - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] crate::send_menu_update(); } @@ -334,7 +334,7 @@ impl ContextMenu for Submenu { self.inner.borrow_mut().gtk_context_menu() } - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] fn compat_items(&self) -> Vec>> { self.inner.borrow_mut().compat_items() } diff --git a/src/lib.rs b/src/lib.rs index 9f4654e..c198c9a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -131,10 +131,10 @@ use std::{cell::RefCell, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crossbeam_channel::{unbounded, Receiver, Sender}; @@ -375,7 +375,7 @@ pub trait ContextMenu { fn gtk_context_menu(&self) -> gtk::Menu; /// Get all menu items within this context menu. - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] fn compat_items(&self) -> Vec>>; /// Shows this menu as a context menu for the specified `NSView`. @@ -454,15 +454,15 @@ impl MenuEvent { } } -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] static MENU_UPDATE_CHANNEL: Lazy<(Sender<()>, Receiver<()>)> = Lazy::new(unbounded); -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub fn recv_menu_update() -> std::result::Result<(), crossbeam_channel::RecvError> { MENU_UPDATE_CHANNEL.1.recv() } -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub fn send_menu_update() { let _ = MENU_UPDATE_CHANNEL.0.send(()); } diff --git a/src/menu.rs b/src/menu.rs index 58471b5..784e672 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -4,10 +4,10 @@ use std::{cell::RefCell, rc::Rc}; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{dpi::Position, util::AddOp, ContextMenu, IsMenuItem, MenuId, MenuItemKind}; @@ -409,7 +409,7 @@ impl ContextMenu for Menu { self.inner.borrow_mut().gtk_context_menu() } - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] fn compat_items(&self) -> Vec>> { self.inner.borrow_mut().compat_items() } diff --git a/src/platform_impl/gtk/mod.rs b/src/platform_impl/gtk/mod.rs index b6ca45c..10b63bc 100644 --- a/src/platform_impl/gtk/mod.rs +++ b/src/platform_impl/gtk/mod.rs @@ -27,10 +27,10 @@ use std::{ sync::atomic::{AtomicBool, Ordering}, }; -#[cfg(feature = "ksni")] +#[cfg(feature = "linux-ksni")] use std::sync::Arc; -#[cfg(feature = "ksni")] +#[cfg(feature = "linux-ksni")] use arc_swap::ArcSwap; static COUNTER: Counter = Counter::new(); @@ -258,7 +258,7 @@ impl Menu { } /// Returns a list of menu items that has been added to this menu. - #[cfg(feature = "ksni")] + #[cfg(feature = "linux-ksni")] pub fn compat_items(&self) -> Vec>> { self.children .iter() @@ -964,7 +964,7 @@ impl MenuChild { self.children.as_ref().unwrap().to_vec() } - #[cfg(feature = "ksni")] + #[cfg(feature = "linux-ksni")] pub fn compat_items(&self) -> Vec>> { self.children .as_ref() diff --git a/src/platform_impl/mod.rs b/src/platform_impl/mod.rs index aeb751b..0f68c71 100644 --- a/src/platform_impl/mod.rs +++ b/src/platform_impl/mod.rs @@ -20,10 +20,10 @@ use std::{ rc::Rc, }; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use std::sync::Arc; -#[cfg(all(feature = "ksni", target_os = "linux"))] +#[cfg(all(feature = "linux-ksni", target_os = "linux"))] use arc_swap::ArcSwap; use crate::{IsMenuItem, MenuItemKind}; @@ -120,7 +120,7 @@ impl MenuItemKind { } } - #[cfg(all(feature = "ksni", target_os = "linux"))] + #[cfg(all(feature = "linux-ksni", target_os = "linux"))] pub(crate) fn compat_child(&self) -> Arc> { use crate::items::*; match self {