lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
179 stars 135 forks source link

[WIP] TaskBar plugin refactor #2007

Closed gfgit closed 4 months ago

gfgit commented 5 months ago

Equivalent to #2029 but for Qt5

It should be easy to rebase Qt6 port on top of this

gfgit commented 5 months ago

@palinek

gfgit commented 5 months ago

We could use this code also for Desktop Switch plugin

tsujan commented 5 months ago

@gfgit, you wanted a review from me, but this isn't my area of expertise. IMO, @palinek is the best reviewer here.

gfgit commented 5 months ago

Ok. I tryed making a wayland backend but first we need perting to Qt 6 and for layer shell we need Qt 6.6 which has some important improvments

tsujan commented 5 months ago

@gfgit, your work is very appreciated.

stefonarch commented 5 months ago

Compiles fine here too, no issues found atm.

stefonarch commented 4 months ago

I did some heavy testing of most taskbar features and settings, didn't find any regression (just noticed how much I really miss this plugin under wayland).

gfgit commented 4 months ago

@stefonarch I've pushed wayland branch on my fork. It works only on KWin Wayland and needs a custom .desktop file with X-KDE-Wayland-Interfaces=org_kde_plasma_window_management (Please check spelling) This protocol is considered special and so is available only to "priviledged clients", in order to be one you have to add this line. Then put the desktop file in /usr/share/applications I did not test adding this line to the already existing desktop file in autostart folder, if this works too let me know.

https://github.com/gfgit/lxqt-panel/tree/wayland_taskbar

gfgit commented 4 months ago

About this PR, I think this backend class should be not specific to taskbar but a global, stored inside LXQtApplication class. Infact panel itself tracks window interactions for the autohide logic and so it would need same X/Wayland abstraction. The also other plugins (showdesktop, desktopswitch, keyboardindicator, colorpicker, etc...) use X11 directly and would need new abstraction. We could make one big abstract class and rewire everithing to use it. Or instead multiple smaller classes providing abstract interfaces for window managment, workspace managment, color picking etc. Each of them implemented both on X11 and on various Wayland protocols depending on specific compositor used. So I don't think this should be merged as is. It's also needs coordination with Qt6 port as one will be rebased on top of the other

stefonarch commented 4 months ago

Nice, will test tomorrow morning, but where can I get layer-shell-qt v.6 on Neon?

gfgit commented 4 months ago

Nice, will test tomorrow morning, but where can I get layer-shell-qt v.6 on Neon?

I'm using neon developer edition which basically is neon unstable. Which version of layer shell is used on Neon testing? Otherwise you might compile it from git, it is quite small

gfgit commented 4 months ago

Reading their git log it seems LayerShellQt 5.91.0 already contains the popup fix and requires Qt 6.6

stefonarch commented 4 months ago

Neededliblayershellqt-dev or similar and forgot to disable systray-plugin but then it compiled with some new stuff :)

[ 91%] Generating lxqt-panel_zh_TW.qm
Updating '/home/user/gfgit/lxqt-panel/build/panel/lxqt-panel_zh_TW.qm'...
    Generated 79 translation(s) (79 finished and 0 unfinished)
[ 91%] Generating qwayland-plasma-window-management.cpp
[ 91%] Generating qwayland-plasma-window-management.h
[ 91%] Generating wayland-plasma-window-management-client-protocol.h
<stdin>:64: warning: since version not increasing

But testing in a kwin_wayland session it didn't show open applications, I thought maybe it needs some plasma stuff or env vars too, but the taskbar doesn't show apps in plasma too, but exclusive zone works (fullscreen pcmanfm-qt in screenshot). For some reason changing from bottom to top panel was applied only after some window changes. But as plasma-wayland freezes all the time I can't test much on plasma, better in nested kwin_wayland sessions.

screen_area_mer_07:23:08_

stefonarch commented 4 months ago

Besides taskbar I found:

But really nice all, just wonder why the taskbar doesn't work. Maybe because it's neon unstable and not developer.

https://github.com/lxqt/lxqt-panel/assets/10681413/b21f2cbf-cac3-45b6-886f-a286e75be326

EDIT: Exclusive zone and placement is working fine also on labwc.

Note that using kwin_wayland some Plasma things come for free, this needs systemsettings also installed:

gfgit commented 4 months ago

I thought maybe it needs some plasma stuff or env vars too

Put the desktop in /usr/share instead of local folder inside your home. I think the reason here is that only root user can do that so it's trusted while anyone could modify desktop files inside home directory

gfgit commented 4 months ago

Also how do you make these small videos/gifs? And how do you upload them? I have troubles uploading on github, often I have to edit again the messsge and remove and re-upload content

stefonarch commented 4 months ago

Also how do you make these small videos/gifs?

Only working in labwc/sway ecc:

#!/bin/bash
# Select screen area for recording
# Usage "screenrecorder filename"
wf-recorder -f /tmp/$1.mp4 -g "$(slurp)"

then I switch to the desktop with the VM. Until some months ago GH sayd there were corrupted, wf-recorder is updated. In plasma no idea, but labwc -s konsole works there too I guess.

Put the desktop in /usr/share instead of local folder inside your home.

Will try that, although now the VM has some troubles.

stefonarch commented 4 months ago

Didn't help moving it to /usr/share/applications, for some reason often the panel is now unresponsive in the nested session. Will fire up a new VM with developer edition on the PC which has more power.

The video here was 3,2Mb

gfgit commented 4 months ago

Ok so now this should be almost equivalent to #2029 but for Qt5 @tsujan Do you think this could be worked out before Qt6 port or is just a waste of time backporting to Qt5?

gfgit commented 4 months ago

@stefonarch sometimes I hit this error:

ninja: error: dependency cycle: panel/lxqt-panel_autogen/timestamp -> panel/qwayland-org-kde-plasma-virtual-desktop.h -> panel/lxqt-panel_autogen -> panel/CMakeFiles/lxqt-panel_autogen -> panel/lxqt-panel_autogen/timestamp

Cleaning build directory and doing a full build seems to fix it temporarily

stefonarch commented 4 months ago

Fired up a developer edition, but got the same results (and quite tired from Neon/Plasma freezes): taskbar no,exclusive zone yes. I use a compila script which removes and recreates build dir so I didn't see that.

tsujan commented 4 months ago

@tsujan Do you think this could be worked out before Qt6 port or is just a waste of time backporting to Qt5?

I think the Qt6 port should take priority, but I also like to see your refactoring in the next release. In the end, it depends on which PR is reviewed first. When KF6 comes to Manjaro Testing, I'll start to review your Qt6 PRs.

Thanks for the hard work!

stefonarch commented 4 months ago

or is just a waste of time backporting to Qt5?

Maybe you didn't see, it's announced: https://alternativeto.net/news/2024/2/lxqt-2-0-will-transition-entirely-to-qt6-with-initial-wayland-compatibility/ taken from here: https://lxqt-project.org/blog/2024/02/15/qt-6-and-wayland/

Other linux news sites have cited more poorly and written about more wayland support, but who knows if we finish even in time for Qt6 in April, but I've good feeling :)

gfgit commented 4 months ago

Ok great. Than I'll close this and keep only #2029