-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
frontend: Enforce Qt to have a DE-agnostic behavior on Linux #11815
base: master
Are you sure you want to change the base?
frontend: Enforce Qt to have a DE-agnostic behavior on Linux #11815
Conversation
@dimtpap, seems like qt-wayland does something about CSD/SSD or KWin enforces it (I don't know if I can do something…). Edit: Unlike GTK, Qt has zero stable platform API for this kind of thing. |
On behalf of Gnome users, can I ask you to not change the title bars please? The generic CSDs in Qt are very bad and don't work properly on any desktop, which is why the Gnome-specific ones were created in the first place. Applications that don't use custom title bars have no reason to interfere with the ones provided by Qt. |
This decoration was only created and proposed to upstream for almost the same reason that FedoraQt made the qgnome platform plugin.
In the GTK ecosystem, you can opt-in to use libadwaita (as a platform), and so your app will look like an GNOME app. We really had issue with third party Qt plugins being enforced on OBS in the past, this PR is also to prevent to happen again. |
That would make sense if you were actually using custom title bars like libadwaita applications do. But as it is now, you're just interfering with the upstream Qt choice of which decorations to use on which desktop. Whether window decorations are rendered by the compositor (as with Plasma Wayland and X11) or by the application (Gnome Wayland, Windows) is really just an implementation detail, which is why Qt doesn't present any actual API to change it and you have to resort to hacks like modifying environment variables.
The Gnome window decoration plugin isn't third-party though, it's part of Qt and better supported than the generic ones. If anything, the Bradient decorations are more likely to cause issues in the future. |
It would probably be more helpful to list specific issues that you think OBS will be affected by. Preferably to provide screenshots of the issue and platform affected. Right now there are screenshots showing they appear to work exactly as intended on gnome and kde environments. |
Okay, here are some examples. Not all of these are obvious from the screenshots, some of them only become obvious when you're actually using the program with these title bars.
I'd also like to point out that in any other Qt application, the window title at least changes color on inactive windows. So something your code is doing is actually breaking that, whereas the Gnome-style title bars are designed to avoid that by using their own color palettes. So ironically, the Bradient plugin is actually the one causing more issues for your application. |
Likely the same on other DE.
Same on other DE.
There is no settings portal for that and relying on GNOME specific settings is a no.
Same on other DE.
Same on other DE.
Likely the same on other DE.
Same on other DE. The point of the PR is having OBS to get the same behavior on all DE without exception. |
For testing the correct behavior on GNOME, you need to make sure that FedoraQt plugins are not installed at all so if you are using the Flatpak or using Fedora. Those can be happen to be installed and are not supported by OBS. |
Which "other DE" are you using to make this comparison? According to the Wayland protocol explorer, every other non-reference desktop compositor supports the XDG decoration protocol. So in fact, Gnome is the only desktop that uses the CSD decorations.
Why do you say that this change gets "the same behavior on all DE without exception", when every other desktop (including KDE, as you already admitted) still uses the SSD decorations? Unless you're going to force the use of the Bradient decorations on every desktop, this justification doesn't make sense. |
This is about having OBS (and mainly Qt) to behave the same on all DE and since unfortunately Qt enforce the use SSD when asked by the compositor (where we wished it does not). And I repeat, enforcing those values also prevent undesired third-party to change Qt's behavior. In the long term if we happen to be able to make sure that SSD is never applied, it will be done. |
96b420c
to
932953e
Compare
Description
Enforce Qt to have a DE-agnostic behavior on Linux
I didn't have Plasma screenshot since I have no machine under it.
Before (with Qt 6.8 on GNOME):
After:
Motivation and Context
If the platform theme is not enforced, while Plasma Wayland enforce SSD decoration (which is fine-ish) a certain option if enabled is will lead to some menubar issues. Multiple users have met an issue where OBS had no menubar under Plasma.
Also there is the fact that with the KDE platform we can end up with the Plasma file chooser (not portal) but with OBS style which is not a good visual, xdgdesktopportal enforce the portal which avoid the style issue.
If the wayland decoration is not enforced, under GNOME, Qt itself (since 6.8) will try to enforce a GNOME-like decoration (Fedora already done the same with their own Qt plugins). DO NOT mix it up with GNOME X11 SSD decoration.
There is also third-party Qt plugins (e.g. qt5ct, qgnome) that caused their share of issues in the past, removing them from the list of potential culprit still can be useful.
I think this is not controversial to expect OBS Studio to look the same under any desktop environment.
How Has This Been Tested?
Ran locally OBS (outside of a Flatpak) and no issue were met using file chooser (use portals now rather the GTK 3 dialog) and the window decoration is Bradient.
Types of changes
Checklist: