-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fix Intel crash in ThemeManager on macOS #13543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
17f175d
77c3d97
be8e789
822c982
dfe4aa6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,13 @@ public ThemeManager(WorkspacePreferences workspacePreferences, | |
this.workspacePreferences = Objects.requireNonNull(workspacePreferences); | ||
this.fileUpdateMonitor = Objects.requireNonNull(fileUpdateMonitor); | ||
this.updateRunner = Objects.requireNonNull(updateRunner); | ||
this.themeWindowManager = ThemeWindowManagerFactory.create(); | ||
ThemeWindowManager tempThemeWindowManager = null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do not use "temp" prefix in JabRef. Do without. With "this." you have the different scoping. Maybe do without local variable and in the catch block set to null? |
||
try { | ||
tempThemeWindowManager = ThemeWindowManagerFactory.create(); | ||
} catch (UnsatisfiedLinkError | RuntimeException e) { | ||
LOGGER.error("Failed to create ThemeWindowManager (likely due to native library compatibility issues on ARM64)", e); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do debug instead of warn It's Intel and not ARM |
||
} | ||
this.themeWindowManager = tempThemeWindowManager; | ||
|
||
this.baseStyleSheet = StyleSheet.create(Theme.BASE_CSS).get(); | ||
this.theme = workspacePreferences.getTheme(); | ||
|
@@ -121,7 +127,13 @@ private void applyDarkModeToWindow(Stage stage, boolean darkMode) { | |
return; | ||
} | ||
|
||
themeWindowManager.setDarkModeForWindowFrame(stage, darkMode); | ||
if (themeWindowManager != null) { | ||
try { | ||
themeWindowManager.setDarkModeForWindowFrame(stage, darkMode); | ||
} catch (UnsatisfiedLinkError | RuntimeException e) { | ||
LOGGER.error("Failed to set dark mode for window frame (likely due to native library compatibility issues on ARM64)", e); | ||
} | ||
} | ||
LOGGER.debug("Applied {} mode to window: {}", darkMode ? "dark" : "light", stage); | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need; feature was introduced after the last release