fix: start fullscreen issues

This commit is contained in:
neoapps-dev
2026-06-07 23:33:30 +03:00
parent 495e82e8d6
commit 8bf6116b05
2 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ pub fn run() {
.setup(|app| { .setup(|app| {
let app_handle = app.handle().clone(); let app_handle = app.handle().clone();
let config = config::load_config_raw(app_handle.clone()); let config = config::load_config_raw(app_handle.clone());
if config.start_fullscreen.unwrap_or(true) { if config.start_fullscreen.unwrap_or(false) {
if let Some(window) = app_handle.get_webview_window("main") { if let Some(window) = app_handle.get_webview_window("main") {
let _ = window.set_fullscreen(true); let _ = window.set_fullscreen(true);
} }
+3 -6
View File
@@ -65,7 +65,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) {
configRaw.rpcEnabled, configRaw.musicVol, configRaw.sfxVol, configRaw.isDayTime, configRaw.rpcEnabled, configRaw.musicVol, configRaw.sfxVol, configRaw.isDayTime,
configRaw.profile, configRaw.linuxRunner, configRaw.perfBoost, configRaw.customEditions, configRaw.profile, configRaw.linuxRunner, configRaw.perfBoost, configRaw.customEditions,
configRaw.legacyMode, configRaw.animationsEnabled, configRaw.mangohudEnabled, configRaw.legacyMode, configRaw.animationsEnabled, configRaw.mangohudEnabled,
configRaw.extraLaunchArgs, configRaw.launchPrefix, configRaw.launchEnvVars configRaw.extraLaunchArgs, configRaw.launchPrefix, configRaw.launchEnvVars, configRaw.startFullscreen
]); ]);
const game = useMemo(() => gameRaw, [ const game = useMemo(() => gameRaw, [
@@ -134,6 +134,7 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) {
extraLaunchArgs: config.extraLaunchArgs, extraLaunchArgs: config.extraLaunchArgs,
launchPrefix: config.launchPrefix, launchPrefix: config.launchPrefix,
launchEnvVars: config.launchEnvVars, launchEnvVars: config.launchEnvVars,
startFullscreen: config.startFullscreen
}).catch(console.error); }).catch(console.error);
} }
}, [ }, [
@@ -142,26 +143,22 @@ export function LauncherProvider({ children }: { children: React.ReactNode }) {
config.vfxEnabled, config.animationsEnabled, config.vfxEnabled, config.animationsEnabled,
config.rpcEnabled, config.musicVol, config.sfxVol, config.legacyMode, config.rpcEnabled, config.musicVol, config.sfxVol, config.legacyMode,
config.mangohudEnabled, config.extraLaunchArgs, config.launchPrefix, config.mangohudEnabled, config.extraLaunchArgs, config.launchPrefix,
config.launchEnvVars, config.isLoaded config.launchEnvVars, config.isLoaded, config.startFullscreen
]); ]);
useEffect(() => { useEffect(() => {
const setupVisibilityDetection = async () => { const setupVisibilityDetection = async () => {
try { try {
const { listen } = await import("@tauri-apps/api/event"); const { listen } = await import("@tauri-apps/api/event");
const unlistenClose = await listen("tauri://close-requested", () => { const unlistenClose = await listen("tauri://close-requested", () => {
console.log("Window close requested - hiding music");
setIsWindowVisible(false); setIsWindowVisible(false);
}); });
const unlistenShow = await listen("tauri://window-shown", () => { const unlistenShow = await listen("tauri://window-shown", () => {
console.log("Window shown - resuming music");
setIsWindowVisible(true); setIsWindowVisible(true);
}); });
const unlistenFocus = await listen("tauri://focus", () => { const unlistenFocus = await listen("tauri://focus", () => {
console.log("Window focused - resuming music");
setIsWindowVisible(true); setIsWindowVisible(true);
}); });