Repository navigation
linux: respect GNOME window button layouts in the Snap - #350994
Open
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Open
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Dmitriy Vasyura (dmitrivMS) wants to merge 1 commit into
Conversation
Run the GLib helpers with the classic Snap's core24 runtime and prefer host schemas so resetting the layout preserves distribution defaults. Use native controls on GNOME Shell Wayland without changing the fallback for other desktops that advertise GNOME compatibility. Fixes #176467 Co-authored-by: Copilot <[email protected]>
Contributor
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the desktop-aware Snap Wayland window-controls changes.
No open issues 🎉
What changed in this PR
This PR addresses #176467 by making the Linux Snap follow GNOME window-button layouts in recognized GNOME Shell Wayland sessions, while preserving explicit user choices and existing defaults on other desktops.
Changes:
- Centralizes Snap Wayland controls defaults, selecting native controls for recognized GNOME sessions and retaining custom controls for Phosh and other desktops.
- Updates the launcher to prefer host settings schemas and run GLib helpers with the core24 loader and libraries.
- Expands tests for desktop-specific defaults and explicit window-control choices.
| File | Description |
|---|---|
src/vs/workbench/electron-browser/desktop.contribution.ts |
Uses the shared helper for the registered controls default. |
src/vs/platform/window/test/common/window.test.ts |
Covers GNOME, Phosh, other desktops, and explicit overrides. |
src/vs/platform/window/common/window.ts |
Centralizes desktop-aware Snap Wayland controls selection. |
resources/linux/snap/electron-launch |
Prefers host schemas and isolates GLib helpers from host libraries. |
Review effort: Balanced
Dmitriy Vasyura (dmitrivMS)
marked this pull request as ready for review
November 29, 2026 06:47
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge
November 29, 2026 06:47
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.
Fixes #176467
The Linux Snap kept all three window buttons on the right even when GNOME was configured to hide them or move them to the left. The
.debalready followed those settings on the same Electron version (package comparison).This makes native controls the default for recognized GNOME Shell Wayland sessions in the Snap. Other Wayland desktops keep their existing default, including Phosh, which also advertises
GNOMEfor compatibility. Explicitwindow.controlsStylechoices still take precedence.The classic launcher also needs to run its two GLib helpers with the core24 loader and libraries: on Ubuntu 22.10 the schema compiler otherwise picked up the older host GLib and failed, and the GIO cache omitted the dconf backend. The launcher prefers the host’s compiled settings schemas so resetting the layout restores the distribution default; the Snap’s schemas remain available as a fallback. No Electron or GLib upgrade is required.
Screenshots
Published Insiders Snap 2654 versus the first local fix, with four explicitly configured layouts:
The final fix also restores Ubuntu’s three native controls after a reset and preserves the three custom controls on Phoc with the
Phosh:GNOMEsession identifier:How to verify
window.titleBarStyleset tocustomandwindow.controlsStyleunset. Open a GTK reference window. Both should start with the distribution’s button layout.gsettings set org.gnome.desktop.wm.preferences button-layout ':close', thengsettings set org.gnome.desktop.wm.preferences button-layout 'close:minimize,maximize'. Both should first show only Close on the right, then Close on the left and the other two buttons on the right, without restarting.gsettings reset org.gnome.desktop.wm.preferences button-layout. Both should return to the distribution default (Minimize, Maximize, Close on Ubuntu).Phosh:GNOMEsession, leavewindow.controlsStyleunset and confirm that the Snap still draws its three custom buttons.Validation
XDG_DATA_DIRSboth set and unset. Six launcher checks passed for user, system, and fallback schema lookup.pnpm run compile-client— passed.env -u WAYLAND_DISPLAY XDG_SESSION_TYPE=x11 xvfb-run -a ./scripts/test.sh --no-sandbox --run src/vs/platform/window/test/common/window.test.ts --reporter spec— 14 passed.pnpm run oxlint src/vs/platform/window/common/window.ts src/vs/platform/window/test/common/window.test.ts src/vs/workbench/electron-browser/desktop.contribution.tsandbash -n resources/linux/snap/electron-launch— passed.