fix(linux): stop forcing GTK window decorations (#23) - #25
Conversation
|
@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. |
There was a problem hiding this comment.
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.
8362a3d to
403effb
Compare
1. Double media session on Windows/macOSYou're right 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 ( 2. No close/minimize on GNOME/KDEThe "no custom buttons on Linux" change was too blunt. Instead of hiding them everywhere, the app now detects the compositor via a new 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. |
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.jsonconfigures 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.mediaSessionto 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 verifypassescargo testpasses (ifsrc-tauri/changed)Ran the app and used the affected screen
Screenshot or clip below (UI changes)
Preview
Notes for the reviewer
decorations: falseconfig. Users who want the OS frame can re-enable it.