winft / wrapland

Qt/C++ library wrapping libwayland
GNU Lesser General Public License v2.1
6 stars 2 forks source link

[QUESTION] Layer Shell Example for Qt Application #86

Closed romangg closed 5 months ago

romangg commented 1 year ago

In GitLab by @ngortheone on Dec 29, 2022, 06:28

Hi @romangg

Please advice on how to use layer-shell protocol with Wrapland for basic Qt app.

I tried using https://invent.kde.org/plasma/layer-shell-qt but it seems to be pretty buggy, especially when an app creates popups (popups take over the entire screen and input). Now I am trying to figure out if I can use Wrapland for this. My goal is to create a Widget-based app similar to https://github.com/Alexays/Waybar. I need QMenuBar and QActions to work properly - spawn xdg_popups for the main window, which is a layer_shell surface.

Thanks!

P.S. Perhaps this could also be added docs/examples/tests

romangg commented 1 year ago

I tried using https://invent.kde.org/plasma/layer-shell-qt but it seems to be pretty buggy

You can try the Wrapland Client library instead of course. The library is more low-level I assume (haven't looked at layer-shell-qt in detail) but it can integrate with your Qt app rather easily.

The Wrapland interface you finally want to write code against is LayerShellV1/LayerSurfaceV1.

There is currently sadly not enough documentation for the the Client library. But you can imitate what we do in the layer shell unit test does.