Skip to content

Commit bb3d7d2

Browse files
Johanclaude
andcommitted
fix: Firefox window buttons in KDE VNC containers
Firefox on Wayland uses its own CSD by default (tabs-in-titlebar mode) and only shows a close button. Fix via two mechanisms: 1. browser.tabs.inTitlebar=0 via Firefox system autoconfig — forces Firefox to request server-side decorations from kwin, which then provides the full Breeze titlebar with minimize/maximize/close. 2. library=org.kde.breeze in kwinrc — explicitly loads the Breeze decoration plugin so kwin provides proper SSD to all apps. Both files are written to the container filesystem during bootstrap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 35bd976 commit bb3d7d2

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/CreateMachineDialog.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,7 @@ export function CreateMachineDialog({ images, onClose, onRefresh, onAddNotificat
707707
// never loses minimized windows to a different virtual desktop.
708708
const kwinrcContent = [
709709
'[org.kde.kdecoration2]',
710+
'library=org.kde.breeze',
710711
'ButtonsOnLeft=',
711712
'ButtonsOnRight=IAX',
712713
'',
@@ -918,6 +919,23 @@ export function CreateMachineDialog({ images, onClose, onRefresh, onAddNotificat
918919
{ superuser: 'require' }
919920
).replace('[Desktop Entry]\nHidden=true\n');
920921

922+
// Firefox autoconfig: force browser.tabs.inTitlebar=0 so Firefox requests
923+
// server-side decorations (SSD) from kwin instead of drawing its own minimal
924+
// CSD that only shows a close button. With inTitlebar=0, kwin provides the
925+
// Breeze titlebar with the full button set (ButtonsOnRight=IAX).
926+
await cockpit.spawn(
927+
['mkdir', '-p', `/var/lib/machines/${name}/usr/lib64/firefox/defaults/pref`],
928+
{ superuser: 'require', err: 'out' }
929+
);
930+
await cockpit.file(
931+
`/var/lib/machines/${name}/usr/lib64/firefox/defaults/pref/autoconfig.js`,
932+
{ superuser: 'require' }
933+
).replace('pref("general.config.filename", "firefox.cfg");\npref("general.config.obscure_value", 0);\n');
934+
await cockpit.file(
935+
`/var/lib/machines/${name}/usr/lib64/firefox/firefox.cfg`,
936+
{ superuser: 'require' }
937+
).replace('// Firefox system autoconfig\npref("browser.tabs.inTitlebar", 0);\n');
938+
921939
// Mask fwupd: firmware update daemon cannot function in a container
922940
// (no hardware devices, no kernel firmware interfaces). Without masking,
923941
// fwupd.service fails to start and KDE Discover shows "unit failed" in

0 commit comments

Comments
 (0)