flathub / io.github.dosbox-staging

https://flathub.org/apps/details/io.github.dosbox-staging
4 stars 4 forks source link

Use system title bars on Wayland #40

Closed AsciiWolf closed 10 months ago

AsciiWolf commented 10 months ago

The DOSBox Staging Flatpak currently uses a non-native window title bar when running on Wayland:

Screenshot

Please, consider fixing this if possible. The easiest workaround to this issue is to change the fallback-x11 socket to x11.

Eonfge commented 10 months ago

the titlebar is libdecor. FreeDesktop defaults to SDL2 with libdecor, so all packages using that version of SDL2 have the same behaviour.

For reference, I changed it three months ago: https://github.com/flathub/io.github.dosbox-staging/commit/20331ddf26ebe24a976eff7950c8357636a626df

Eonfge commented 10 months ago

Use system title bars on Wayland

What Desktop Environment do you use? KDE's implementation of Client-Side Decorations an Server-Side Decorations is more mature and inline with the FreeDesktop standard. GNOME users are less well off.

AsciiWolf commented 10 months ago

the titlebar is libdecor. FreeDesktop defaults to SDL2 with libdecor, so all packages using that version of SDL2 have the same behaviour.

Ah, I am dumb. :-) Thanks for the explanation!

AsciiWolf commented 10 months ago

What Desktop Environment do you use? KDE's implementation of Client-Side Decorations an Server-Side Decorations is more mature and inline with the FreeDesktop standard. GNOME users are less well off.

Fully updated GNOME 45 on Fedora 39.

rderooy commented 10 months ago

@AsciiWolf Gnome does not support server-side-decorations (SSD), and requires that all non-native gnome apps implement CSD (client-side-decorations). Therefore SDL2 needs a CSD implementation for which it uses libdecor.

Other desktop environments such as KDE do support SSD, and therefore don't need libdecor, and non-native apps will still have native title bars and controls.

Unfortunately the Gnome developers have put their foot down on this and have indicated not wanting to implement SSD.

AsciiWolf commented 10 months ago

Is there any way for libdecor to use decorations from system theme (such as Adwaita on GNOME)?

rderooy commented 10 months ago

That would be something for https://gitlab.freedesktop.org/libdecor/libdecor

AsciiWolf commented 10 months ago

From what I found online:

libdecor has a GTK plugin, so it can draw GTK-based window decorations to Wayland clients.

So, native GTK window decorations should be possible. But for some reason, they do not work with Flatpak. It is possible that the GTK plugin is disabled at build time. Anyway, this is probably out-of-scope of this Flatpak and will have to be fixed in the fd.o runtime.

Eonfge commented 10 months ago

I wanted to double-check it... and we only have GNOME to blame. This is Dosbox on KDE 5.27

Screenshot from 2024-01-02 19-29-02

AsciiWolf commented 10 months ago

This is not about GNOME, but about the bundled libdecor in the fd.o runtime not having its GTK plugin enabled (because the plugin depends on GTK and fd.o does not include GTK libs). There is no point in discussing about server-side-decorations vs client-side-decorations. Anyway, as I pointed out, this needs to be fixed in the fd.o runtime if possible.

Eonfge commented 10 months ago

It is somewhat SSD related... You can't expect fd.o to include GTK plugins when they don't know if the host uses GTK. It might work if we compile against the GNOME SDK but that would then be detrimental to KDE users.

AsciiWolf commented 10 months ago

You can't expect fd.o to include GTK plugins when they don't know if the host uses GTK.

That is a false assumption (especially considering that majority of today's GNU/Linux users use GNOME). What is true however is that it would be problematic and pointless to include GTK (or Qt) directly in the fd.o runtime. Ideally, the GTK / GNOME plugin of libdecor should not require GTK, but I am not sure whether this is possible.