Repository navigation
Conversation
Read the button layout from GNOME, Cinnamon and MATE (gsettings), KDE Plasma (kwinrc) and Xfce (xfconf) when the desktop app starts, and show those buttons in that order on that side. Windows keeps its buttons on the right and macOS its traffic lights; neither lets people move them. Lay out the window chrome by side rather than platform, size it by the number of buttons, and keep narrow toolbars clear of the buttons: the phone-width bar on the left, and the chat heading at the 900px minimum window width on the right (also a Windows fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read GNOME's button-layout only on GNOME, Unity, Budgie and Pantheon: other desktops often install its schema without setting it, and its default would leave a single close button. Layer system kwinrc files from XDG_CONFIG_DIRS under the user's, and build those paths with POSIX separators so the tests pass on Windows. Start the backend before waiting for the layout; only the first window waits. Keep the phone-width bar's own inset beside left-side controls, and check macOS's traffic-light space in the browser layout check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parse each kwinrc on its own, least important first, so a group from one file never carries into the next, and apply KConfig's [$i] locks on files, groups and keys so an administrator's locked layout wins as it does in KWin. Start the layout lookup only after taking the single-instance lock, and describe the Linux behavior in the desktop README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Treat [group][subgroup] headers as their own groups and localized keys such as ButtonsOnLeft[fr] as their own entries, as KConfig does. Give the whole layout lookup a two-second limit, file reads included, since the first window waits for it. Check the preload's copy of the argument prefix, and say in the README that KDE and Xfce fall back to their own defaults. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A stalled or failed lookup on KDE Plasma or Xfce now falls back to that desktop's own default layout, as the README describes. Ignore relative XDG directories, skip nameless headers inside a kwinrc, dedupe button names in the page, and keep the test machine's system kwinrc out of the Linux smoke test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
An alternative to #344. Rather than adding Window buttons and Window button style settings, the desktop app follows the system:
Linux: when the app starts, the main process reads the desktop's own button layout and the window shows those buttons, in that order, on that side.
gsettings get org.gnome.desktop.wm.preferences button-layoutorg.cinnamon.desktop.wm.preferencesorg.mate.Marco.generalButtonsOnLeft/ButtonsOnRightinkwinrc, with the user's file layered over system ones inXDG_CONFIG_DIRSxfconf-query -c xfwm4 -p /general/button_layoutGNOME's default (
appmenu:close), for example, shows a single close button on the right. On other desktops (LXQt, COSMIC, tiling window managers), or when the layout can't be read, the window keeps today's close/minimize/maximize on the left. GNOME's schema is read only on the desktops above: other desktops often install it without setting it, and its default would leave a single close button.Windows: unchanged. Wide buttons stay on the right; Windows has no setting to move them.
macOS: unchanged. The native traffic lights stay on the left.
Button style follows the platform (compact on Linux, wide on Windows), so there's no setting and no new UI text.
How it works:
desktop/window-buttons.tsparses the three layout formats and picks one side. When a layout splits the buttons, they gather on the side that holds close.additionalArgumentsentry, then the page aspapilotDesktop.windowButtons.desktop-chrome.cssnow keys ondata-desktop-controls="left|right"instead of the platform, and sizes the controls from--desktop-window-buttons(the button count).Two existing layout bugs the new browser check found, fixed here:
Modern Web Guidance
single-line-overflow: the manuscript shortcut's label truncates withoverflow: hiddenand an ellipsis inside a flex item givenmin-width: 0. This avoids a flex item that refuses to shrink below its text. The full name stays the button's accessible name and is shown in full in the sidebar.form-factor-adaptation: keep text and controls clear of system UI (here, the window buttons) at every width, rather than letting them collide at the minimum window size.How it was checked
npm run typechecknpm test: newtests/window-buttons.test.ts(parsers, per-desktop detection, unknown desktops,kwinrclayering) passes. One failure,tests/desktop-layer.test.ts("the engine keeps only dependencies…"), also fails onmainin my local checkout (mupdfinnode_modules) and isn't related to this change.npm run buildnode --import tsx scripts/check-appearance.mjs: new window-button section covers Linux default, GNOME (close only, right), full right, two-button left, Windows, and macOS's traffic-light space. For each it checks button order, edge placement, and that no toolbar control sits under the buttons with the sidebar open or hidden, at 1440, 900 and 680px. Screenshots inspected.npm run test:desktop(development app, macOS) passes.scripts/check-desktop.mjsnow gives the Linux run a known KDEkwinrcand asserts the page receives and renders that layout, so the Linux desktop CI job covers the real main → preload → page path.process.argventries fromadditionalArguments.Limitations
gtk-decoration-layoutoverride insettings.iniisn't read. The window manager's setting is used.🤖 Generated with Claude Code