Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

fix: restore linux fullscreen on show and appimage warning

Tw9389c58e32d712
diff --git a/bin/builders/BaseBuilder.ts b/bin/builders/BaseBuilder.ts
index c87feb45..607a2d03 100644
--- a/bin/builders/BaseBuilder.ts
+++ b/bin/builders/BaseBuilder.ts
@@ -242,7 +242,7 @@ export default abstract class BaseBuilder {
// Warn users about potential AppImage build failures on modern Linux systems.
// The linuxdeploy tool bundled in Tauri uses an older strip tool that doesn't
// recognize the .relr.dyn section introduced in glibc 2.38+.
- if (process.platform === 'linux' && this.options.targets === 'appimage') {
+ if (process.platform === 'linux' && target === 'appimage') {
if (!buildEnv.NO_STRIP) {
logger.warn(
'⚠ Building AppImage on Linux may fail due to strip incompatibility with glibc 2.38+',
diff --git a/src-tauri/src/app/setup.rs b/src-tauri/src/app/setup.rs
index 642e81f3..191aa1b7 100644
--- a/src-tauri/src/app/setup.rs
+++ b/src-tauri/src/app/setup.rs
@@ -13,6 +13,7 @@ pub fn set_system_tray(
app: &AppHandle,
show_system_tray: bool,
tray_icon_path: &str,
+ init_fullscreen: bool,
) -> tauri::Result<()> {
if !show_system_tray {
app.remove_tray_by_id("pake-tray");
@@ -40,6 +41,11 @@ pub fn set_system_tray(
"show_app" => {
if let Some(window) = app.get_webview_window("pake") {
window.show().unwrap();
+ #[cfg(target_os = "linux")]
+ if init_fullscreen && !window.is_fullscreen().unwrap_or(false) {
+ let _ = window.set_fullscreen(true);
+ let _ = window.set_focus();
+ }
}
}
"quit" => {
@@ -58,6 +64,10 @@ pub fn set_system_tray(
} else {
window.show().unwrap();
window.set_focus().unwrap();
+ #[cfg(target_os = "linux")]
+ if init_fullscreen && !window.is_fullscreen().unwrap_or(false) {
+ let _ = window.set_fullscreen(true);
+ }
}
}
}
@@ -82,7 +92,11 @@ pub fn set_system_tray(
Ok(())
}
-pub fn set_global_shortcut(app: &AppHandle, shortcut: String) -> tauri::Result<()> {
+pub fn set_global_shortcut(
+ app: &AppHandle,
+ shortcut: String,
+ init_fullscreen: bool,
+) -> tauri::Result<()> {
if shortcut.is_empty() {
return Ok(());
}
@@ -113,6 +127,10 @@ pub fn set_global_shortcut(app: &AppHandle, shortcut: String) -> tauri::Result<(
} else {
window.show().unwrap();
window.set_focus().unwrap();
+ #[cfg(target_os = "linux")]
+ if init_fullscreen && !window.is_fullscreen().unwrap_or(false) {
+ let _ = window.set_fullscreen(true);
+ }
}
}
}
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index f6265477..3845ee08 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -95,9 +95,10 @@ pub fn run_app() {
app.app_handle(),
show_system_tray,
&pake_config.system_tray_path,
+ init_fullscreen,
)
.unwrap();
- set_global_shortcut(app.app_handle(), activation_shortcut).unwrap();
+ set_global_shortcut(app.app_handle(), activation_shortcut, init_fullscreen).unwrap();
// Show window after state restoration to prevent position flashing
// Unless start_to_tray is enabled, then keep it hidden