diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 5bd4f85ba..667508347 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -108,7 +108,7 @@ public class AppMainWindow { var scene = new Scene(content, -1, -1, false); content.prefWidthProperty().bind(scene.widthProperty()); content.prefHeightProperty().bind(scene.heightProperty()); - scene.setFill(Color.TRANSPARENT); + AppWindowStyle.setSceneFill(scene); stage.setScene(scene); if (AppPrefs.get() != null) { diff --git a/app/src/main/java/io/xpipe/app/core/window/AppSideWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppSideWindow.java index c8357c666..1b805844b 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppSideWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppSideWindow.java @@ -86,7 +86,7 @@ public class AppSideWindow { if (AppMainWindow.get() != null && AppMainWindow.get().getStage().isShowing() && !AppMainWindow.get().getStage().isIconified()) { alert.initOwner(AppMainWindow.get().getStage()); } - alert.getDialogPane().getScene().setFill(Color.TRANSPARENT); + AppWindowStyle.setSceneFill(alert.getDialogPane().getScene()); var stage = (Stage) alert.getDialogPane().getScene().getWindow(); AppModifiedStage.prepareStage(stage); AppWindowStyle.addIcons(stage); diff --git a/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java b/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java index 4137a6f57..db9005071 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppWindowStyle.java @@ -2,15 +2,18 @@ package io.xpipe.app.core.window; import io.xpipe.app.core.*; import io.xpipe.app.issue.TrackEvent; +import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.util.GlobalTimer; import io.xpipe.core.OsType; import javafx.application.Platform; +import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.css.PseudoClass; import javafx.scene.Scene; import javafx.scene.input.*; +import javafx.scene.paint.Color; import javafx.stage.Stage; import java.time.Duration; @@ -19,6 +22,17 @@ import java.util.List; public class AppWindowStyle { + public static void setSceneFill(Scene scene) { + if (OsType.ofLocal() != OsType.LINUX) { + scene.setFill(Color.TRANSPARENT); + return; + } + + scene.fillProperty().bind(Bindings.createObjectBinding(() -> { + return AppPrefs.get() != null && AppPrefs.get().theme().getValue().isDark() ? Color.BLACK : Color.WHITE; + }, AppPrefs.get().theme())); + } + public static void addMaximizedPseudoClass(Stage stage) { stage.getScene().rootProperty().subscribe(root -> { stage.maximizedProperty().subscribe(v -> { diff --git a/app/src/main/java/io/xpipe/app/util/RemoteDesktopWindow.java b/app/src/main/java/io/xpipe/app/util/RemoteDesktopWindow.java index 6be704cb7..89f839cca 100644 --- a/app/src/main/java/io/xpipe/app/util/RemoteDesktopWindow.java +++ b/app/src/main/java/io/xpipe/app/util/RemoteDesktopWindow.java @@ -85,7 +85,7 @@ public class RemoteDesktopWindow { stage = new Stage(); stage.initStyle(StageStyle.UNIFIED); var scene = new Scene(new Region()); - scene.setFill(Color.TRANSPARENT); + AppWindowStyle.setSceneFill(scene); stage.setScene(scene); stage.getScene().setRoot(new RemoteDesktopDockComp().build()); stage.setWidth(AppMainWindow.get() != null ? AppMainWindow.get().getStage().getWidth() : 1280);