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

[WIP] TaskBar plugin refactor #2007

Closed
wants to merge 27 commits into from

Conversation

gfgit
Copy link
Member

@gfgit gfgit commented Jan 23, 2024

Equivalent to #2029 but for Qt5

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

@gfgit gfgit force-pushed the work/gfgit/refactor_taskbar branch 2 times, most recently from 9b6ae3f to 8916fe6 Compare February 4, 2024 11:57
@gfgit gfgit marked this pull request as ready for review February 4, 2024 11:58
@gfgit
Copy link
Member Author

gfgit commented Feb 4, 2024

@palinek

  • I've made an abstract interface ILXQtTaskbarAbstractBackend which has functions related to window managment which is implemented by LXQtTaskbarX11Backend and can be also reimplemented using Wayland protocols.
    This class can be used as singleton.

  • LXQtTaskBarProxyModel is a Qt item model which uses ILXQtTaskbarAbstractBackend, one instance per each taskbar plugin. Right now it's not used but we could convert LXQtTaskGroup to a QListView with special styled delegate.

  • Settings are kept in the UI code, since they don't belong to model except for grouping which changes the behavior of the proxy model

  • I've also cleaned up includes, and used more forward declaration. This seems to make CI fail but I can build without errors locally

@gfgit gfgit requested a review from tsujan February 7, 2024 19:31
@gfgit
Copy link
Member Author

gfgit commented Feb 7, 2024

We could use this code also for Desktop Switch plugin

@tsujan
Copy link
Member

tsujan commented Feb 7, 2024

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

@tsujan tsujan requested review from palinek and removed request for tsujan February 7, 2024 19:36
@gfgit
Copy link
Member Author

gfgit commented Feb 7, 2024

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
Copy link
Member

tsujan commented Feb 7, 2024

@gfgit, your work is very appreciated.

@stefonarch
Copy link
Member

stefonarch commented Feb 8, 2024

Compiles fine here too, no issues found atm.

@stefonarch
Copy link
Member

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
Copy link
Member Author

gfgit commented Feb 20, 2024

@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
Copy link
Member Author

gfgit commented Feb 20, 2024

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
Copy link
Member

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

@gfgit
Copy link
Member Author

gfgit commented Feb 20, 2024

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
Copy link
Member Author

gfgit commented Feb 20, 2024

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

@stefonarch
Copy link
Member

Needed liblayershellqt-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
Copy link
Member

stefonarch commented Feb 21, 2024

Besides taskbar I found:

  • panel orientation not always detected when moving it
  • always aligned at left
  • panel not always moved
  • panel config window opens at 0 0

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

kwin_taskbar6.mp4

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:

  • warning sounds if closing a terminal with a running app
  • screenshots only using spectacle
  • lockscreen with its settings

@gfgit
Copy link
Member Author

gfgit commented Feb 21, 2024

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
Copy link
Member Author

gfgit commented Feb 21, 2024

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
Copy link
Member

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
Copy link
Member

stefonarch commented Feb 21, 2024

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 added 21 commits February 21, 2024 15:55
Also use it to get window icon
- Don't rely on global screen coordinates

- This will be needed for future Wayland port,
  Where we don't have global screen coordinates

- Keep compatible behavior on X11
TODO: properly setup CMake filse
This new window propery flag is needed to notify geometry changes
@gfgit
Copy link
Member Author

gfgit commented Feb 21, 2024

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
Copy link
Member Author

gfgit commented Feb 21, 2024

@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
Copy link
Member

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
Copy link
Member

tsujan commented Feb 21, 2024

@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!

@gfgit gfgit force-pushed the work/gfgit/refactor_taskbar branch from e923744 to 3aee064 Compare February 21, 2024 15:23
@stefonarch
Copy link
Member

stefonarch commented Feb 21, 2024

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
Copy link
Member Author

gfgit commented Feb 22, 2024

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

@gfgit gfgit closed this Feb 22, 2024
@gfgit gfgit deleted the work/gfgit/refactor_taskbar branch February 22, 2024 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants