Skip to content

Commit

Permalink
Prevent gsettings exception when running headless on Linux
Browse files Browse the repository at this point in the history
Closes #1209
  • Loading branch information
tresf committed Nov 4, 2023
1 parent 0d6d085 commit e9d97d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/qz/common/TrayManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public TrayManager(boolean isHeadless) {
// Set up the shortcut name so that the UI components can use it
shortcutCreator = ShortcutCreator.getInstance();

SystemUtilities.setSystemLookAndFeel();
SystemUtilities.setSystemLookAndFeel(headless);
iconCache = new IconCache();

if (SystemUtilities.isSystemTraySupported(headless)) { // UI mode with tray
Expand Down
5 changes: 4 additions & 1 deletion src/qz/utils/SystemUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,10 @@ public static boolean prefersMaskTrayIcon() {
return false;
}

public static boolean setSystemLookAndFeel() {
public static boolean setSystemLookAndFeel(boolean headless) {
if(headless) {
return false;
}
try {
UIManager.getDefaults().put("Button.showMnemonics", Boolean.TRUE);
boolean darculaThemeNeeded = true;
Expand Down

0 comments on commit e9d97d6

Please sign in to comment.