SteamOS: always use dark theme

Co-authored-by: AAGaming <aagaming@riseup.net>
This commit is contained in:
Vendicated 2024-01-06 03:20:13 +01:00
parent dfa9d248d3
commit b059516707
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

View file

@ -6,7 +6,7 @@
import "./ipc";
import { app, BrowserWindow } from "electron";
import { app, BrowserWindow, nativeTheme } from "electron";
import { checkUpdates } from "updater/main";
import { DATA_DIR } from "./constants";
@ -15,6 +15,7 @@ import { createWindows, mainWin } from "./mainWindow";
import { registerMediaPermissionsHandler } from "./mediaPermissions";
import { registerScreenShareHandler } from "./screenShare";
import { Settings } from "./settings";
import { isDeckGameMode } from "./utils/steamOS";
if (IS_DEV) {
require("source-map-support").install();
@ -43,6 +44,9 @@ function init() {
"WinRetrieveSuggestionsOnlyOnDemand,HardwareMediaKeyHandling,MediaSessionService,WidgetLayering"
);
// In the Flatpak on SteamOS the theme is detected as light, but SteamOS only has a dark mode, so we just override it
if (isDeckGameMode) nativeTheme.themeSource = "dark";
app.on("second-instance", (_event, _cmdLine, _cwd, data: any) => {
if (data.IS_DEV) app.quit();
else if (mainWin) {