From 0f48ccd53c8a6c636a14a138517b9a174f19c822 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sat, 7 Dec 2024 00:20:02 +0200 Subject: [PATCH] fix(native-buttons): regressions on server --- src/public/app/layouts/desktop_layout.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/public/app/layouts/desktop_layout.js b/src/public/app/layouts/desktop_layout.js index 04c4cef73..8d0a667a1 100644 --- a/src/public/app/layouts/desktop_layout.js +++ b/src/public/app/layouts/desktop_layout.js @@ -84,6 +84,7 @@ import CopyImageReferenceButton from "../widgets/floating_buttons/copy_image_ref import ScrollPaddingWidget from "../widgets/scroll_padding.js"; import ClassicEditorToolbar from "../widgets/ribbon_widgets/classic_editor_toolbar.js"; import options from "../services/options.js"; +import utils from "../services/utils.js"; export default class DesktopLayout { constructor(customWidgets) { @@ -95,6 +96,7 @@ export default class DesktopLayout { const launcherPaneIsHorizontal = (options.get("layoutOrientation") === "horizontal"); const launcherPane = this.#buildLauncherPane(launcherPaneIsHorizontal); + const isElectron = (utils.isElectron()); const isMac = (window.glob.platform === "darwin"); const isWindows = (window.glob.platform === "win32"); const hasNativeTitleBar = (window.glob.hasNativeTitleBar); @@ -103,7 +105,7 @@ export default class DesktopLayout { * If true, the tab bar is displayed above the launcher pane with full width; if false (default), the tab bar is displayed in the rest pane. * On macOS we need to force the full-width tab bar on Electron in order to allow the semaphore (window controls) enough space. */ - const fullWidthTabBar = (launcherPaneIsHorizontal || (!hasNativeTitleBar && isMac)); + const fullWidthTabBar = (launcherPaneIsHorizontal || (isElectron && !hasNativeTitleBar && isMac)); const customTitleBarButtons = (hasNativeTitleBar && !isMac && !isWindows); return new RootContainer(true)