Skip to content

Commit dd9251a

Browse files
1111mplucasfernog
andauthored
fix: the system theme obtained is always light (#1091)
* fix(macos): the system theme obtained is always light (tauri-apps/tauri#12894) Signed-off-by: The1111mp <The1111mp@outlook.com> * add change file --------- Signed-off-by: The1111mp <The1111mp@outlook.com> Co-authored-by: Lucas Nogueira <lucas@tauri.app>
1 parent 996e28d commit dd9251a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changes/fix-macos-theme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tao": patch
3+
---
4+
5+
Fix `Window::theme()` always returning `Theme::Light` and `WindowEvent::ThemeChanged()` not delivered on macOS.

src/platform_impl/macos/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub(super) fn get_ns_theme() -> Theme {
332332
let app_class = class!(NSApplication);
333333
let app: id = msg_send![app_class, sharedApplication];
334334
let has_theme: bool = msg_send![app, respondsToSelector: sel!(effectiveAppearance)];
335-
if has_theme {
335+
if !has_theme {
336336
return Theme::Light;
337337
}
338338
let appearance: id = msg_send![app, effectiveAppearance];

0 commit comments

Comments
 (0)