From 6c2d8b63cd7c247dc7db17056364b5475a12b32d Mon Sep 17 00:00:00 2001 From: Vishnu Tejas E Date: Sun, 8 Mar 2026 16:50:59 +0530 Subject: [PATCH] Fix double-clicking top bar not toggling maximize in linux --- frontend/src/components/window/TitleBar.svelte | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/window/TitleBar.svelte b/frontend/src/components/window/TitleBar.svelte index 58708cca27..597fa9a456 100644 --- a/frontend/src/components/window/TitleBar.svelte +++ b/frontend/src/components/window/TitleBar.svelte @@ -19,6 +19,7 @@ const tooltip = getContext("tooltip"); let menuBarLayout: Layout = []; + let lastMouseDown = 0; $: showFullscreenButton = $appWindow.platform === "Web" || $fullscreen.windowFullscreen || (isDesktop() && $appWindow.fullscreen); $: isFullscreen = isDesktop() ? $appWindow.fullscreen : $fullscreen.windowFullscreen; @@ -41,7 +42,21 @@ {/if} - !isFullscreen && editor.handle.appWindowDrag()} on:dblclick={() => !isFullscreen && editor.handle.appWindowMaximize()} /> + { + if (isFullscreen) return; + + const now = Date.now(); + if (now - lastMouseDown < 500) { + lastMouseDown = 0; + editor.handle.appWindowMaximize(); + } else { + lastMouseDown = now; + editor.handle.appWindowDrag(); + } + }} + /> {#if $appWindow.platform !== "Mac"}