Skip to content

Commit 246b33f

Browse files
marcusbritanicusgfgitisf63LXQtBotPeterJespersen
authored
Wlroots backend (#2088)
* Initial backend plugin infrastructure * Update licenses * lxqttaskbartypes.h: fix ShowOnAll desktops flag value * Fix backend load logic: do not load zero score backends - Fix X11 backend to return zero score on non-X11 platforms * LXQtPanelApplication: always find best backend at startup If preferred backend is set try it first. Do not set preferred backend automatically. It must be user choice. * Panel backends: pass string argument for score calculation - Split XDG_CURRENT_DESKTOP - Skip LXQTPANEL_PLUGIN_PATH if empty * Backends: change name scheme libwmbackend_<platform>.so * LXQtPanelApplication: only consider plugins with valid names * LXQtPanelApplication: fix empty backend message * TaskBar: add experimental KWin Wayland backend NOTE: works only on KWin - Choose backend at runtime - Windows filter logic is re-evaluated on window property changes LXQtTaskBarPlasmaWindowManagment: implement showDesktop() LXQtTaskbarWaylandBackend: do not show transient windows LXQtTaskBarPlasmaWindowManagment: fix destructor TODO TODO: is this correct? Seems to call wl_proxy_destroy underneath LXQtPanel: basic virtual desktop support on Plasma Wayland Add desktop file to be recognized by KWin Wayland NOTE: absolute path is needed inside .desktop file for this to work use CMake to get it. - Prevent double dekstop file installed in autostart LXQtTaskbarWaylandBackend: return only accepted windows - reloadWindows() force removal and readding of windows This fixes changing windows grouping settings and adding taskbar plugin AFTER panel is started. Both situations resulted in empty taskbar previously LXQtTaskbarWaylandBackend: fix workspace logic LXQtTaskbarWaylandBackend: fix workspace removal logic LXQtTaskbarWaylandBackend: implement moving window to virtual desktop workspace LXQtPlasmaWaylandWorkspaceInfo: fix signedness comparison CMake: move panel WM backends to separate libraries LXQtTaskbarWaylandBackend: possibly fix crash on showDesktop for non- KWin Update license headers LXQtTaskbarWaylandBackend: add dummy setDesktopLayout() Implement LXQtWMBackendKWinWaylandLibrary - Add Desktop Environment detection * LXQtPanel: workaround KAcceleratorManager changing button text FIXME TODO TODO: is this correct approach? * ColorPicker: use XDG Desktop Portal on Wayland TODO TODO: show error message when not supported * Hide lxqt-panel application from applications menu - Add NoDisplay=true to .desktop file CMake: rename autostart desktop variable * LXQtWMBackend_KWinWayland: announce DesktopSwitch support * LXQtWMBackend_KWinWayland: fix minimize on click not working * Backend detection and Wlroots backend * Fix autodetection on user choice failure * wmbackend_kwin_wayland: Compare against kwin_wayland. * Iterate through all parts of the XDG_CURRENT_DESKTOP. Add river to wlroots * Set size policy in plugin-backlight and plugin-colorpicker (#2049) Fixes an inconsistency in themes when they expect an expanding size policy, which is what most plugins have set. Some themes that do this: KDE-Plasma, Ambiance, Kvantum. Further stylesheet changes in some themes will be needed to match themes exactly. * Weblate commit (#2085) Translate-URL: https://translate.lxqt-project.org/projects/lxqt-panel/plugin-fancymenu/da/ Translate-URL: https://translate.lxqt-project.org/projects/lxqt-panel/plugin-kbindindicator/ko/ Translation: LXQt Panel/plugin-fancymenu Translation: LXQt Panel/plugin-kbindicator Co-authored-by: Peter Jespersen <flywheel@illogical.dk> Co-authored-by: 이정희 <daemul72@gmail.com> * Initial backend plugin infrastructure * Update licenses * lxqttaskbartypes.h: fix ShowOnAll desktops flag value * Fix backend load logic: do not load zero score backends - Fix X11 backend to return zero score on non-X11 platforms * LXQtPanelApplication: always find best backend at startup If preferred backend is set try it first. Do not set preferred backend automatically. It must be user choice. * Panel backends: pass string argument for score calculation - Split XDG_CURRENT_DESKTOP - Skip LXQTPANEL_PLUGIN_PATH if empty * Backends: change name scheme libwmbackend_<platform>.so * LXQtPanelApplication: only consider plugins with valid names * LXQtPanelApplication: fix empty backend message * TaskBar: add experimental KWin Wayland backend NOTE: works only on KWin - Choose backend at runtime - Windows filter logic is re-evaluated on window property changes LXQtTaskBarPlasmaWindowManagment: implement showDesktop() LXQtTaskbarWaylandBackend: do not show transient windows LXQtTaskBarPlasmaWindowManagment: fix destructor TODO TODO: is this correct? Seems to call wl_proxy_destroy underneath LXQtPanel: basic virtual desktop support on Plasma Wayland Add desktop file to be recognized by KWin Wayland NOTE: absolute path is needed inside .desktop file for this to work use CMake to get it. - Prevent double dekstop file installed in autostart LXQtTaskbarWaylandBackend: return only accepted windows - reloadWindows() force removal and readding of windows This fixes changing windows grouping settings and adding taskbar plugin AFTER panel is started. Both situations resulted in empty taskbar previously LXQtTaskbarWaylandBackend: fix workspace logic LXQtTaskbarWaylandBackend: fix workspace removal logic LXQtTaskbarWaylandBackend: implement moving window to virtual desktop workspace LXQtPlasmaWaylandWorkspaceInfo: fix signedness comparison CMake: move panel WM backends to separate libraries LXQtTaskbarWaylandBackend: possibly fix crash on showDesktop for non- KWin Update license headers LXQtTaskbarWaylandBackend: add dummy setDesktopLayout() Implement LXQtWMBackendKWinWaylandLibrary - Add Desktop Environment detection * LXQtPanel: workaround KAcceleratorManager changing button text FIXME TODO TODO: is this correct approach? * ColorPicker: use XDG Desktop Portal on Wayland TODO TODO: show error message when not supported * Hide lxqt-panel application from applications menu - Add NoDisplay=true to .desktop file CMake: rename autostart desktop variable * LXQtWMBackend_KWinWayland: announce DesktopSwitch support * LXQtWMBackend_KWinWayland: fix minimize on click not working * Backend detection and Wlroots backend * Fix autodetection on user choice failure * wmbackend_kwin_wayland: Compare against kwin_wayland. * Iterate through all parts of the XDG_CURRENT_DESKTOP. Add river to wlroots * Rever changes to color-picker * Revert changes to color-picker, attempt 2 --------- Co-authored-by: Filippo Gentile <filippogentile@disroot.org> Co-authored-by: isf63 <121320947+isf63@users.noreply.github.com> Co-authored-by: LXQtBot <72348767+LXQtBot@users.noreply.github.com> Co-authored-by: Peter Jespersen <flywheel@illogical.dk> Co-authored-by: 이정희 <daemul72@gmail.com>
1 parent 9bd9b5f commit 246b33f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5402
-357
lines changed

autostart/CMakeLists.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
file(GLOB DESKTOP_FILES_IN *.desktop.in)
1+
set(AUTOSTART_DESKTOP_FILES_IN lxqt-panel.desktop.in)
22

33
# Translations **********************************
44
lxqt_translate_desktop(DESKTOP_FILES
55
SOURCES
6-
${DESKTOP_FILES_IN}
6+
${AUTOSTART_DESKTOP_FILES_IN}
77
USE_YAML
88
)
99
add_custom_target(lxqt_panel_autostart_desktop_files ALL DEPENDS ${DESKTOP_FILES})
@@ -14,3 +14,12 @@ install(FILES
1414
DESTINATION "${LXQT_ETC_XDG_DIR}/autostart"
1515
COMPONENT Runtime
1616
)
17+
18+
configure_file(lxqt-panel_wayland.desktop.in lxqt-panel_wayland.desktop @ONLY)
19+
20+
install(FILES
21+
"${CMAKE_CURRENT_BINARY_DIR}/lxqt-panel_wayland.desktop"
22+
DESTINATION "/usr/share/applications"
23+
RENAME "lxqt-panel.desktop"
24+
COMPONENT Runtime
25+
)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[Desktop Entry]
2+
Type=Application
3+
TryExec=lxqt-panel
4+
NoDisplay=true
5+
6+
# NOTE: KWin wants absolute path here, get it from CMake install path
7+
Exec=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/lxqt-panel
8+
9+
# NOTE: adding KDE to make it work under Plasma Wayland session
10+
OnlyShowIn=LXQt;KDE
11+
X-LXQt-Module=true
12+
13+
# Make KWin recognize us as priviledged client
14+
X-KDE-Wayland-Interfaces=org_kde_plasma_window_management

panel/CMakeLists.txt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set(PROJECT lxqt-panel)
22

3-
# TODO
3+
# Window Manager backends
44
add_subdirectory(backends)
55

66
set(PRIV_HEADERS
@@ -21,12 +21,6 @@ set(PRIV_HEADERS
2121
config/configstyling.h
2222
config/configpluginswidget.h
2323
config/addplugindialog.h
24-
25-
backends/ilxqttaskbarabstractbackend.h
26-
backends/lxqttaskbartypes.h
27-
28-
backends/lxqttaskbardummybackend.h
29-
backends/xcb/lxqttaskbarbackend_x11.h
3024
)
3125

3226
# using LXQt namespace in the public headers.
@@ -35,9 +29,6 @@ set(PUB_HEADERS
3529
pluginsettings.h
3630
ilxqtpanelplugin.h
3731
ilxqtpanel.h
38-
39-
backends/ilxqttaskbarabstractbackend.h
40-
backends/lxqttaskbartypes.h
4132
)
4233

4334
set(SOURCES
@@ -57,11 +48,6 @@ set(SOURCES
5748
config/configstyling.cpp
5849
config/configpluginswidget.cpp
5950
config/addplugindialog.cpp
60-
61-
backends/ilxqttaskbarabstractbackend.cpp
62-
63-
backends/lxqttaskbardummybackend.cpp
64-
backends/xcb/lxqttaskbarbackend_x11.cpp
6551
)
6652

6753
set(UI
@@ -122,6 +108,7 @@ target_link_libraries(${PROJECT}
122108
KF6::WindowSystem
123109
LayerShellQt::Interface
124110
${STATIC_PLUGINS}
111+
lxqt-panel-backend-common
125112
)
126113

127114
set_property(TARGET ${PROJECT} PROPERTY ENABLE_EXPORTS TRUE)

panel/backends/CMakeLists.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
# Common interface for Window Manager abstraction backend
2+
# This also contains dummy backend
3+
4+
add_library(lxqt-panel-backend-common STATIC
5+
6+
lxqttaskbartypes.h
7+
ilxqtabstractwmiface.h
8+
ilxqtabstractwmiface.cpp
9+
10+
lxqtdummywmbackend.h
11+
lxqtdummywmbackend.cpp
12+
)
13+
14+
target_link_libraries(lxqt-panel-backend-common
15+
Qt6::Gui
16+
)
17+
18+
add_subdirectory(wayland)
119
add_subdirectory(xcb)
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/* BEGIN_COMMON_COPYRIGHT_HEADER
2+
* (c)LGPL2+
3+
*
4+
* LXQt - a lightweight, Qt based, desktop toolset
5+
* https://lxqt.org
6+
*
7+
* Copyright: 2023 LXQt team
8+
* Authors:
9+
* Filippo Gentile <filippogentile@disroot.org>
10+
*
11+
* This program or library is free software; you can redistribute it
12+
* and/or modify it under the terms of the GNU Lesser General Public
13+
* License as published by the Free Software Foundation; either
14+
* version 2.1 of the License, or (at your option) any later version.
15+
*
16+
* This library is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+
* Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General
22+
* Public License along with this library; if not, write to the
23+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24+
* Boston, MA 02110-1301 USA
25+
*
26+
* END_COMMON_COPYRIGHT_HEADER */
27+
28+
29+
#include "ilxqtabstractwmiface.h"
30+
31+
ILXQtAbstractWMInterface::ILXQtAbstractWMInterface(QObject *parent)
32+
: QObject(parent)
33+
{
34+
35+
}
36+
37+
void ILXQtAbstractWMInterface::moveApplicationToPrevNextDesktop(WId windowId, bool next)
38+
{
39+
int count = getWorkspacesCount();
40+
if (count <= 1)
41+
return;
42+
43+
int targetWorkspace = getWindowWorkspace(windowId) + (next ? 1 : -1);
44+
45+
// Wrap around
46+
if (targetWorkspace > count)
47+
targetWorkspace = 1; //Ids are 1-based
48+
else if (targetWorkspace < 1)
49+
targetWorkspace = count;
50+
51+
setWindowOnWorkspace(windowId, targetWorkspace);
52+
}

panel/backends/ilxqttaskbarabstractbackend.h renamed to panel/backends/ilxqtabstractwmiface.h

Lines changed: 58 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,48 @@
1-
#ifndef ILXQTTASKBARABSTRACTBACKEND_H
2-
#define ILXQTTASKBARABSTRACTBACKEND_H
1+
/* BEGIN_COMMON_COPYRIGHT_HEADER
2+
* (c)LGPL2+
3+
*
4+
* LXQt - a lightweight, Qt based, desktop toolset
5+
* https://lxqt.org
6+
*
7+
* Copyright: 2023 LXQt team
8+
* Authors:
9+
* Filippo Gentile <filippogentile@disroot.org>
10+
*
11+
* This program or library is free software; you can redistribute it
12+
* and/or modify it under the terms of the GNU Lesser General Public
13+
* License as published by the Free Software Foundation; either
14+
* version 2.1 of the License, or (at your option) any later version.
15+
*
16+
* This library is distributed in the hope that it will be useful,
17+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+
* Lesser General Public License for more details.
20+
*
21+
* You should have received a copy of the GNU Lesser General
22+
* Public License along with this library; if not, write to the
23+
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
24+
* Boston, MA 02110-1301 USA
25+
*
26+
* END_COMMON_COPYRIGHT_HEADER */
27+
28+
29+
#ifndef ILXQT_ABSTRACT_WM_INTERFACE_H
30+
#define ILXQT_ABSTRACT_WM_INTERFACE_H
331

432
#include <QObject>
533

34+
#include "../lxqtpanelglobals.h"
635
#include "lxqttaskbartypes.h"
736

837
class QIcon;
938
class QScreen;
1039

11-
class ILXQtTaskbarAbstractBackend : public QObject
40+
class LXQT_PANEL_API ILXQtAbstractWMInterface : public QObject
1241
{
1342
Q_OBJECT
1443

1544
public:
16-
explicit ILXQtTaskbarAbstractBackend(QObject *parent = nullptr);
45+
explicit ILXQtAbstractWMInterface(QObject *parent = nullptr);
1746

1847
// Backend
1948
virtual bool supportsAction(WId windowId, LXQtTaskBarBackendAction action) const = 0;
@@ -96,4 +125,28 @@ class ILXQtTaskbarAbstractBackend : public QObject
96125
void activeWindowChanged(WId windowId);
97126
};
98127

99-
#endif // ILXQTTASKBARABSTRACTBACKEND_H
128+
class LXQT_PANEL_API ILXQtWMBackendLibrary
129+
{
130+
public:
131+
/**
132+
Destroys the ILXQtWMBackendLibrary object.
133+
**/
134+
virtual ~ILXQtWMBackendLibrary() {}
135+
136+
/**
137+
Returns the score of this backend for current detected environment.
138+
This is used to select correct backend at runtime
139+
**/
140+
virtual int getBackendScore(const QString& key) const = 0;
141+
142+
/**
143+
Returns the root component object of the backend. When the library is finally unloaded, the root component will automatically be deleted.
144+
**/
145+
virtual ILXQtAbstractWMInterface* instance() const = 0;
146+
};
147+
148+
149+
Q_DECLARE_INTERFACE(ILXQtWMBackendLibrary,
150+
"lxqt.org/Panel/WMInterface/1.0")
151+
152+
#endif // ILXQT_ABSTRACT_WM_INTERFACE_H

panel/backends/ilxqttaskbarabstractbackend.cpp

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)