jlindgren90 / qmpanel

A Minimal Qt-Based Desktop Panel
GNU Lesser General Public License v2.1
13 stars 6 forks source link

Move to Wayland and foreign-toplevel-protocol #6

Closed johanmalm closed 8 months ago

johanmalm commented 8 months ago

Hi there. Hope you're keeping well. Just a quick note to mention https://github.com/johanmalm/tint It's a super simple test panel that I'm using to test a few things with labwc but it demonstrate the following:

jlindgren90 commented 8 months ago

Looks cool! I just did the port to Qt6 a few days ago (was waiting for kwindowsystem 6) but moving to native Wayland was next -- I will definitely take a look at what you've got working (and probably copy from it liberally :)

johanmalm commented 8 months ago

Looks cool! I just did the port to Qt6 a few days ago (was waiting for kwindowsystem 6) but moving to native Wayland was next -- I will definitely take a look at what you've got working (and probably copy from it liberally :)

Excellent :smile: Well, I'm very impressed with what you've done with SNI, etc. I was surprised myself how easy it was to get the layer-shell panel going now with Qt 6.5+. I tried (as you can see in the commit history) a while ago, but it was just not ready then. That WinId thing is the trick to get a MainWindow established and hence your Widgets, etc.

jlindgren90 commented 8 months ago

I did a very rough initial port based on your code: https://github.com/jlindgren90/qmpanel/commits/layershell/ Lots of issues still - menu positioning is not quite right, keyboard focus seems unreliable, and I haven't implemented icons.

johanmalm commented 8 months ago

Do you run it with qmpanel -platform wayland?

I segfault:

kf.windowsystem: static QList<long long unsigned int> KX11Extras::stackingOrder() may only be used on X11
kf.windowsystem: virtual void KX11Extras::connectNotify(const QMetaMethod&) may only be used on X11
kf.windowsystem: virtual void KX11Extras::connectNotify(const QMetaMethod&) may only be used on X11
kf.windowsystem: virtual void KX11Extras::connectNotify(const QMetaMethod&) may only be used on X11
kf.windowsystem: virtual void KX11Extras::connectNotify(const QMetaMethod&) may only be used on X11
kf.windowsystem: static void KX11Extras::setExtendedStrut(WId, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal, qreal) may only be used on X11
[1]    2477 segmentation fault (core dumped)  ./build/qmpanel -platform wayland
jlindgren90 commented 8 months ago

Is that the layershell branch? I would expect that from master but not layershell?

johanmalm commented 8 months ago

Is that the layershell branch? I would expect that from master but not layershell?

Sorry for being so daft. Just tried with 'layershell' branch. Works a treat! Nice :smile:

johanmalm commented 8 months ago

Not sure if it's worth it, but just a thought: https://github.com/NilsBrause/waylandpp

See implementation here: https://github.com/selairi/yatbfw/blob/main/toplevelbutton.cpp

jlindgren90 commented 8 months ago

I made some more changes (implemented icons) and merged the layershell branch into master. Basic features work, but there are enough issues that I wouldn't consider it usable for day-to-day use. I'll open a new bucket issue with a list of things to fix later.

Thanks again for the help!

johanmalm commented 8 months ago

Does the keyboard interactivity work better with this patch? https://github.com/labwc/labwc/pull/1599

Haven’t looked but assume you just use “on-demand”

jlindgren90 commented 8 months ago

I will try it out later on, thanks. Tracking remaining Wayland issues in #7.