From 28fc22642f726b98ac89c92dd3813a8d51e3a33c Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Wed, 14 Jan 2026 14:01:04 +0800 Subject: [PATCH] Fix window_size not building on linux --- packages/window/src/theme.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/window/src/theme.rs b/packages/window/src/theme.rs index c98e737..d2a6dfe 100644 --- a/packages/window/src/theme.rs +++ b/packages/window/src/theme.rs @@ -6,7 +6,7 @@ //! We recommend using either [`Result::unwrap_or`] or [`Result::unwrap_or_default`] to do this. //! //! #### Platform Support -//! Theme is available for Web, Windows, & Mac. Linux is unsupported and Android/iOS has not been tested. +//! Theme is available for Web, Windows, & Mac. Linux is unsupported and Android/iOS are not supported. //! //! # Examples //! An example of using the theme to determine which class to use. @@ -166,7 +166,7 @@ fn listen(mut theme: Signal) { // The listener implementation for desktop targets. (not linux) // This should only be called once. -#[cfg(not(target_family = "wasm"))] +#[cfg(not(any(target_family = "wasm", target_os = "linux")))] fn listen(mut theme: Signal) { use dioxus_desktop::{ WindowEvent, @@ -192,7 +192,7 @@ fn listen(mut theme: Signal) { } // The listener implementation for unsupported targets. -#[cfg(target_os = "linux")] +#[cfg(any(target_os = "linux", target_os = "android", target_os = "ios"))] fn listen(mut theme: Signal) { theme.set(Err(ThemeError::Unsupported)); } @@ -253,7 +253,7 @@ fn get_theme_platform() -> ThemeResult { } // The desktop (except linux) implementation to get the system theme. -#[cfg(not(target_family = "wasm"))] +#[cfg(any(target_os = "windows", target_os = "macos"))] fn get_theme_platform() -> ThemeResult { use dioxus_desktop::DesktopContext; use dioxus_desktop::tao::window::Theme as TaoTheme; @@ -272,7 +272,7 @@ fn get_theme_platform() -> ThemeResult { } // Implementation for unsupported platforms. -#[cfg(not(any(target_family = "wasm", target_os = "windows", target_os = "macos")))] +#[cfg(any(target_os = "linux", target_os = "android", target_os = "ios"))] fn get_theme_platform() -> ThemeResult { Err(ThemeError::Unsupported) }