Skip to content

fix(linux): stop forcing GTK window decorations (#23) - #25

Open
SyahrulBhudiF wants to merge 1 commit into
noFAYZ:mainfrom
SyahrulBhudiF:fix/linux-desktop-ux
Open

fix(linux): stop forcing GTK window decorations (#23)#25
SyahrulBhudiF wants to merge 1 commit into
noFAYZ:mainfrom
SyahrulBhudiF:fix/linux-desktop-ux

Conversation

@SyahrulBhudiF

Copy link
Copy Markdown

What and why

The Linux override pinned decorations to true at startup and the frontend defaulted native controls to on, so every Linux user got a GTK title bar even though tauri.conf.json configures none. Remove the override, default native controls off, and hide the custom window buttons on Linux since the window manager owns them there (and tiling compositors have no minimize).

WebKitGTK bridges navigator.mediaSession to MPRIS automatically, which drives the now-playing notifications some desktops show. A Linux-only "Show in system media controls" toggle clears the session when off.

Closes #23

How it was checked

  • npm run verify passes

  • cargo test passes (if src-tauri/ changed)

  • Ran the app and used the affected screen

  • Screenshot or clip below (UI changes)

  • Preview

image
  • Setting
image image

Notes for the reviewer

  • Behavior change for all Linux users: "Use OS native controls" now defaults to off (it used to default to on), matching the window's decorations: false config. Users who want the OS frame can re-enable it.
  • The custom min/max/close buttons are hidden on Linux because the WM owns them there; tiling compositors like niri have no minimize at all.

@vercel

vercel Bot commented Jul 31, 2026

Copy link
Copy Markdown

@SyahrulBhudiF is attempting to deploy a commit to the Faizan Asad's projects Team on Vercel.

A member of the Team first needs to authorize it.

@noFAYZ noFAYZ left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one blocker, useMediaSession.ts:74:

const mediaSessionEnabled = usesNativeMediaSession || linuxMediaSession;

usesNativeMediaSession is windows-or-macos, so it's true there and the browser bridge now installs on top of SMTC / MPNowPlayingInfoCenter instead of staying off. WebView2 bridges navigator.mediaSession to SMTC itself, so windows gets a second now-playing entry and media keys fire twice. linux is unaffected, which is why it tests clean.

should be !usesNativeMediaSession && linuxMediaSession.

also with native controls defaulting off, linux gets setDecorations(false) and no custom buttons, so GNOME/KDE end up with no close or minimize anywhere. Quitting an app will only be possible through system tray need to consider an better way for better UX

Stop forcing GTK decorations at startup (noFAYZ#23) and default native controls
off so the app's own title bar is used. On Linux the custom window buttons
are hidden only on tiling compositors (niri, sway, hyprland, ...) where the
WM owns window management; GNOME/KDE keep them so close and minimize stay
reachable. Add a Linux-only "Show in system media controls" toggle that
clears navigator.mediaSession, and keep the browser bridge off on
Windows/macOS so it cannot double up with SMTC / MPNowPlayingInfoCenter.
@SyahrulBhudiF

SyahrulBhudiF commented Aug 1, 2026

Copy link
Copy Markdown
Author

1. Double media session on Windows/macOS

You're right usesNativeMediaSession || linuxMediaSession was wrong. The browser mediaSession bridge now only ever runs on Linux:

const mediaSessionEnabled = !usesNativeMediaSession && linuxMediaSession;

On Windows/macOS the bridge stays off and the platform's own SMTC / MPNowPlayingInfoCenter path is the only one. The bridge-clear effect (metadata = null, handlers unset, playbackState "none") runs there too, so nothing stale lingers in the webview's own media session. I also added this reasoning as a comment above the line so it doesn't regress.

2. No close/minimize on GNOME/KDE

The "no custom buttons on Linux" change was too blunt. Instead of hiding them everywhere, the app now detects the compositor via a new desktop_environment command (XDG_CURRENT_DESKTOP) and only hides the custom window buttons on tiling window managers (niri, sway, hyprland, i3, bspwm, dwm, …), where the WM owns window management and there's no minimize to begin with.

On GNOME/KDE/XFCE the custom min/max/close buttons render as before, so close and minimize stay reachable with native controls off. The "Use OS native controls" toggle is unchanged for anyone who wants the OS frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove window decorations on linux

2 participants