diff --git a/CHANGELOG.md b/CHANGELOG.md index 22db2799aeb..7312da4e74b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - When creating a library, if you drag a PDF file containing only a single column, the dialog will now automatically close. [#13262](https://github.com/JabRef/jabref/issues/13262) - We fixed an issue where the tab showing the fulltext search results would appear blank after switching library. [#13241](https://github.com/JabRef/jabref/issues/13241) - Enhanced field selection logic in the Merge Entries dialog when fetching from DOI to prefer valid years and entry types. [#12549](https://github.com/JabRef/jabref/issues/12549) +- We fixed an issue where JabRef crashed on startup on Apple Silicon Macs due to native library compatibility issues in the theme manager. [#13536](https://github.com/JabRef/jabref/issues/13536) ### Removed diff --git a/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java b/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java index d5300c82362..f09d93052be 100644 --- a/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java +++ b/jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java @@ -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; + try { + tempThemeWindowManager = ThemeWindowManagerFactory.create(); + } catch (UnsatisfiedLinkError | RuntimeException e) { + LOGGER.error("Failed to create ThemeWindowManager (likely due to native library compatibility issues on ARM64)", e); + } + 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); }