diff --git a/Taskfile.yml b/Taskfile.yml index bfd879098..9abd79a85 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -96,7 +96,7 @@ tasks: sh: echo {{if eq "arm" ARCH}}arm64{{else}}{{ARCH}}{{end}} GO_LDFLAGS: -linkmode 'external' -extldflags=-static GO_ENV_VARS: - sh: echo "CC=\"zig cc -target {{if eq "arm" ARCH}}aarch64{{else}}x86_64{{end}}-linux-gnu.2.23\"" + sh: echo "CC=\"zig cc -target {{if eq "arm" ARCH}}aarch64-linux-gnu{{else}}x86_64-linux-gnu.2.23{{end}}\"" build:server:internal: requires: diff --git a/emain/emain.ts b/emain/emain.ts index 9447e90c9..1505d6547 100644 --- a/emain/emain.ts +++ b/emain/emain.ts @@ -336,8 +336,10 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi height: winHeight, }; winBounds = ensureBoundsAreVisible(winBounds); + const settings = fullConfig?.settings; const winOpts: Electron.BrowserWindowConstructorOptions = { - titleBarStyle: unamePlatform === "darwin" ? "hiddenInset" : "hidden", + titleBarStyle: + unamePlatform === "darwin" ? "hiddenInset" : settings["window:nativetitlebar"] ? "default" : "hidden", titleBarOverlay: unamePlatform !== "darwin" ? { @@ -362,7 +364,6 @@ function createBrowserWindow(clientId: string, waveWindow: WaveWindow, fullConfi show: false, autoHideMenuBar: true, }; - const settings = fullConfig?.settings; const isTransparent = settings?.["window:transparent"] ?? false; const isBlur = !isTransparent && (settings?.["window:blur"] ?? false); if (isTransparent) { @@ -652,6 +653,10 @@ if (unamePlatform !== "darwin") { const fac = new FastAverageColor(); electron.ipcMain.on("update-window-controls-overlay", async (event, rect: Dimensions) => { + // Bail out if the user requests the native titlebar + const fullConfig = await services.FileService.GetFullConfig(); + if (fullConfig.settings["window:nativetitlebar"]) return; + const zoomFactor = event.sender.getZoomFactor(); const electronRect: Electron.Rectangle = { x: rect.left * zoomFactor, diff --git a/frontend/types/gotypes.d.ts b/frontend/types/gotypes.d.ts index fa036c200..deb0c3acc 100644 --- a/frontend/types/gotypes.d.ts +++ b/frontend/types/gotypes.d.ts @@ -439,6 +439,7 @@ declare global { "window:bgcolor"?: string; "window:reducedmotion"?: boolean; "window:tilegapsize"?: number; + "window:nativetitlebar"?: boolean; "telemetry:*"?: boolean; "telemetry:enabled"?: boolean; }; diff --git a/pkg/wconfig/metaconsts.go b/pkg/wconfig/metaconsts.go index 2b5c78751..dc856f70b 100644 --- a/pkg/wconfig/metaconsts.go +++ b/pkg/wconfig/metaconsts.go @@ -46,6 +46,7 @@ const ( ConfigKey_WindowBgColor = "window:bgcolor" ConfigKey_WindowReducedMotion = "window:reducedmotion" ConfigKey_WindowTileGapSize = "window:tilegapsize" + ConfigKey_WindowNativeTitleBar = "window:nativetitlebar" ConfigKey_TelemetryClear = "telemetry:*" ConfigKey_TelemetryEnabled = "telemetry:enabled" diff --git a/pkg/wconfig/settingsconfig.go b/pkg/wconfig/settingsconfig.go index 20741ed73..2196fe364 100644 --- a/pkg/wconfig/settingsconfig.go +++ b/pkg/wconfig/settingsconfig.go @@ -73,13 +73,14 @@ type SettingsType struct { WidgetClear bool `json:"widget:*,omitempty"` WidgetShowHelp bool `json:"widget:showhelp,omitempty"` - WindowClear bool `json:"window:*,omitempty"` - WindowTransparent bool `json:"window:transparent,omitempty"` - WindowBlur bool `json:"window:blur,omitempty"` - WindowOpacity *float64 `json:"window:opacity,omitempty"` - WindowBgColor string `json:"window:bgcolor,omitempty"` - WindowReducedMotion bool `json:"window:reducedmotion,omitempty"` - WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"` + WindowClear bool `json:"window:*,omitempty"` + WindowTransparent bool `json:"window:transparent,omitempty"` + WindowBlur bool `json:"window:blur,omitempty"` + WindowOpacity *float64 `json:"window:opacity,omitempty"` + WindowBgColor string `json:"window:bgcolor,omitempty"` + WindowReducedMotion bool `json:"window:reducedmotion,omitempty"` + WindowTileGapSize *int64 `json:"window:tilegapsize,omitempty"` + WindowNativeTitleBar bool `json:"window:nativetitlebar,omitempty"` TelemetryClear bool `json:"telemetry:*,omitempty"` TelemetryEnabled bool `json:"telemetry:enabled,omitempty"`