Skip to content
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

Wayland #15

Closed
KAMiKAZOW opened this issue Nov 28, 2016 · 22 comments
Closed

Wayland #15

KAMiKAZOW opened this issue Nov 28, 2016 · 22 comments
Assignees

Comments

@KAMiKAZOW
Copy link
Contributor

F25 defaults to Wayland but Qt5 applications still run using XWayland.

QGnomePlatform should:

Set the QT_QPA_PLATFORM=wayland environment variable.
Disable Qt's built-in CSDs (QT_WAYLAND_DISABLE_WINDOWDECORATION=1).
Make Mutter/GS draw their own Gnome title bars.

@MartinBriza
Copy link
Collaborator

Thanks for the report. I'm planning to support Wayland in near future. However, the current state of Qt Wayland support doesn't allow using it by default in Fedora 25 as of now. As you yourself mentioned, the window decorations are wrong and we'll have to figure out the proper way to get SSDs from mutter. And I think font configuration is wrong too.
However as I said, this is on the roadmap.

@KAMiKAZOW
Copy link
Contributor Author

An alternative to SSDs from Mutter could be to introduce CSDs to KF5 and then use Adwaita's Qt port for those. That way all KF5 could work under Gnome (and other CSD-focused desktops) even if QGnomePlatform is not installed.

@benwaffle
Copy link

Mutter on wayland does not support SSDs. You will have to use Qt's CSDs

@KAMiKAZOW
Copy link
Contributor Author

Unless Martin asks a fellow Red Hat colleague to implement SSD support for Wayland (not even user configurable but when apps request that, comply with that request).

@MartinBriza
Copy link
Collaborator

So we talked about it with a fellow Red Hat colleague and it seems there's currently no way to get SSDs from Mutter, as @benwaffle said.
For now, I'll probably have to implement a decoration in adwaita-qt somehow, I'll have to see about how to do that. Maybe the Mutter situation will change. Most likely it won't though. I'll talk to Martin Graesslin about what he intends to do with the Wayland extension for requesting SSDs.

@glaubersm
Copy link

Hi
One more Wayland issue... gtk open/save dialogs of QT5 apps running under xwayland are not modal onr Gnome
https://bugzilla.gnome.org/show_bug.cgi?id=785797

@glaubersm
Copy link

drop down from open file dialog is misplaced. This bug only happens under Wayland session.
I use Arch Linux, Gnome 3.26.2, GTK+ 3.22.26.

gwenview

@rmader
Copy link

rmader commented Jul 4, 2019

I just toyed a bit with the current state of this (enabling QT_QPA_PLATFORM=wayland) on Fedora 30

Some issues:

  1. The theme is not automatically applied. That means I have to run QT_QPA_PLATFORM=wayland QT_QPA_PLATFORMTHEME='gnome' keepassxc to get the same look as under XWayland (I use Adwaita Dark).
  2. As noted in Wayland #15 (comment), font sizes don't get applied

Other issues, which might be general to QT on Wayland:

  1. Cursor size with fractional scaling: for some reasons, the cursor is bigger when hovering over QT apps. I assume QT does not set the buffer scale correctly. Or it uploads not matching cursor sprites (does QGnomePlatform interfere with cursor sprites?)
  2. Of course missing borders. As mutter/gnome-shell will most probably not implement SSDs, is there a way to express that as style? Edit: maybe we can fork https://github.com/lirios/materialdecoration/tree/master for that?

Apart from that I must say that apps look way better with the Wayland backend when fractional scaling is used (they get scaled up by the compositor otherwise, which looks blurry).
Also worth noting might be that a flickering bug in mutter got fixed in 3.30, according to one comment "one of the last remaining issues before Qt applications can start defaulting to Wayland on gnome-shell"

If there are any bugs left specific to Mutter/GS, please let me know, I might be able to help out at that front.

@glaubersm
Copy link

about cursor size
https://bugreports.qt.io/browse/QTBUG-67579

about window borders
https://bugreports.qt.io/browse/QTBUG-74527

@grulja
Copy link
Collaborator

grulja commented Jul 9, 2019

I just toyed a bit with the current state of this (enabling QT_QPA_PLATFORM=wayland) on Fedora 30

Some issues:

  1. The theme is not automatically applied. That means I have to run QT_QPA_PLATFORM=wayland QT_QPA_PLATFORMTHEME='gnome' keepassxc to get the same look as under XWayland (I use Adwaita Dark).
  2. As noted in #15 (comment), font sizes don't get applied

I don't know why, but Wayland platform plugin doesn't use any gtk/gnome platform theme on gtk based desktops. I have patches to solve all of this on Fedora 31, where I want to have Wayland by default on Gnome. See [this Fedora 31 proposal].(https://fedoraproject.org/wiki/Changes/Qt_Wayland_By_Default_On_Gnome)

I also have Adwaita decorations implemented as part of QGnomePlatform (see https://github.com/FedoraQt/QGnomePlatform/tree/wayland-decoration), I just need to find a way how to draw shadows. This is currently not possible without additions to qtwayland and I already have an idea how it can be done.

@jtojnar
Copy link
Contributor

jtojnar commented Mar 24, 2020

Would using @jadahl's https://gitlab.gnome.org/jadahl/libdecoration help?

@grulja
Copy link
Collaborator

grulja commented Mar 24, 2020

Maybe, I haven't checked yet and didn't know such thing exists. I will look into it and let you know. Thanks for a hint.

@jadahl
Copy link

jadahl commented Mar 24, 2020

I'm not sure libdecorations is in a position where this makes sense for the GNOME Qt platform, e.g. there is no theming integration, and the only backend is a relatively bare bone cairo one. I don't expect a cairo backend to start learning about system themes etc.

@grulja
Copy link
Collaborator

grulja commented Mar 24, 2020

I'm not sure libdecorations is in a position where this makes sense for the GNOME Qt platform, e.g. there is no theming integration, and the only backend is a relatively bare bone cairo one. I don't expect a cairo backend to start learning about system themes etc.

Ok, I was hoping it actually knows about system theme and based on that it would draw me decorations to a buffer I pass to it. At this moment I basically draw just basic Adwaita (light/dark) decorations and if user don't use the Adwaita theme, then the decorations will not match his theme.

@jadahl
Copy link

jadahl commented Mar 24, 2020

My idea for libdecoration is that one day it may be possible to grow a gtk based backend, but I don't expect it to happen soon.

@Esokrates
Copy link

@grulja Could you do something about onscreen keyboard support? I.e. that focusing a text input triggers the gnome-osk on touch devices?

@major-mayer
Copy link

Just a quick heads up: The libdecor project can soon (...?) draw correctly themed window decorations for in with their Cairo/ GTK backend: https://gitlab.gnome.org/jadahl/libdecor/-/merge_requests/43
Maybe this could be the way to go for the Gnome QT Platform?

@grulja
Copy link
Collaborator

grulja commented Jul 26, 2021

Just a quick heads up: The libdecor project can soon (...?) draw correctly themed window decorations for in with their Cairo/ GTK backend: https://gitlab.gnome.org/jadahl/libdecor/-/merge_requests/43
Maybe this could be the way to go for the Gnome QT Platform?

Thanks. I will check and see if it's something we can use in the future.

@christianrauch
Copy link

Since the QGnomePlatform already provides a plugin that implements QWaylandAbstractDecoration I am not sure if it makes a lot of sense to integrate libdecor which itself loads a plugin. It might be more useful to just use the bits of the GTK plugin that create the headerbar and render all the widgets to cairo surfaces.

Additionally, this all uses private Qt API which might restrict access to the underlying Wayland objects (surfaces, connections, ...) or remove that functionality completely at any time. I think it makes more sense trying to get libdecor (or at least the GTK plugin functionality) into upstream Qt so that private API is not used outside of the upstream repo.

@grulja
Copy link
Collaborator

grulja commented Jul 28, 2022

I believe this can be closed now as there is nothing more for Wayland support I can do. We already have our own window decorations and that's it.

@grulja grulja closed this as completed Jul 28, 2022
@godvino
Copy link

godvino commented Jul 28, 2022

Is it expected that QT windows dont have shadows on wayland ?

@grulja
Copy link
Collaborator

grulja commented Jul 28, 2022

We have shadows implemented with Qt 6. This is because Qt 5 didn't have all the required API.

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

No branches or pull requests