Skip to content

Commit

Permalink
CMake: move panel WM backends to separate libraries
Browse files Browse the repository at this point in the history
- QTime is included to fix build errors
  • Loading branch information
gfgit committed Feb 28, 2024
1 parent fc398ba commit f6e9ba9
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 43 deletions.
47 changes: 7 additions & 40 deletions panel/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
set(PROJECT lxqt-panel)

# TODO
# Window Manager abstraction backend
add_subdirectory(backends)

# TODO: move to backend folder
find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS WaylandClient Concurrent)
# TODO: allow compile time selection via CMake variables
set(PANEL_BACKENDS
lxqt-panel-backend-wayland
lxqt-panel-backend-xcb
)


set(PRIV_HEADERS
Expand All @@ -25,17 +28,6 @@ set(PRIV_HEADERS
config/configstyling.h
config/configpluginswidget.h
config/addplugindialog.h

backends/ilxqttaskbarabstractbackend.h
backends/lxqttaskbartypes.h

backends/lxqttaskbardummybackend.h

backends/xcb/lxqttaskbarbackend_x11.h

backends/wayland/lxqttaskbarbackendwayland.h
backends/wayland/lxqttaskbarplasmawindowmanagment.h
backends/wayland/lxqtplasmavirtualdesktop.h
)

# using LXQt namespace in the public headers.
Expand All @@ -44,9 +36,6 @@ set(PUB_HEADERS
pluginsettings.h
ilxqtpanelplugin.h
ilxqtpanel.h

backends/ilxqttaskbarabstractbackend.h
backends/lxqttaskbartypes.h
)

set(SOURCES
Expand All @@ -66,16 +55,6 @@ set(SOURCES
config/configstyling.cpp
config/configpluginswidget.cpp
config/addplugindialog.cpp

backends/ilxqttaskbarabstractbackend.cpp

backends/lxqttaskbardummybackend.cpp

backends/xcb/lxqttaskbarbackend_x11.cpp

backends/wayland/lxqttaskbarbackendwayland.cpp
backends/wayland/lxqttaskbarplasmawindowmanagment.cpp
backends/wayland/lxqtplasmavirtualdesktop.cpp
)

set(UI
Expand Down Expand Up @@ -130,23 +109,11 @@ add_executable(${PROJECT}
${UI}
)

# TODO: move to backend folder
qt6_generate_wayland_protocol_client_sources(${PROJECT}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/backends/wayland/protocols/plasma-window-management.xml
)

qt6_generate_wayland_protocol_client_sources(${PROJECT}
FILES
${CMAKE_CURRENT_SOURCE_DIR}/backends/wayland/protocols/org-kde-plasma-virtual-desktop.xml
)

target_link_libraries(${PROJECT}
${LIBRARIES}
${QTX_LIBRARIES}
KF6::WindowSystem
Qt6::WaylandClient # TODO: Move to backend folder
Qt6::Concurrent
${PANEL_BACKENDS}
LayerShellQt::Interface
${STATIC_PLUGINS}
)
Expand Down
17 changes: 17 additions & 0 deletions panel/backends/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,19 @@
# Common interface for Window Manager abstraction backend
# This also contains dummy backend

add_library(lxqt-panel-backend-common STATIC

lxqttaskbartypes.h
ilxqttaskbarabstractbackend.h
ilxqttaskbarabstractbackend.cpp

lxqttaskbardummybackend.h
lxqttaskbardummybackend.cpp
)

target_link_libraries(lxqt-panel-backend-common
Qt6::Gui
)

add_subdirectory(wayland)
add_subdirectory(xcb)
2 changes: 1 addition & 1 deletion panel/backends/ilxqttaskbarabstractbackend.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "../panel/backends/ilxqttaskbarabstractbackend.h"
#include "ilxqttaskbarabstractbackend.h"


ILXQtTaskbarAbstractBackend::ILXQtTaskbarAbstractBackend(QObject *parent)
Expand Down
31 changes: 31 additions & 0 deletions panel/backends/wayland/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
# Wayland WM Backend

project(lxqt-panel-backend-wayland)

find_package(Qt6 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS WaylandClient Concurrent)

add_library(lxqt-panel-backend-wayland STATIC
lxqttaskbarbackendwayland.h
lxqttaskbarplasmawindowmanagment.h
lxqtplasmavirtualdesktop.h

lxqttaskbarbackendwayland.cpp
lxqttaskbarplasmawindowmanagment.cpp
lxqtplasmavirtualdesktop.cpp
)

qt6_generate_wayland_protocol_client_sources(lxqt-panel-backend-wayland
FILES
${CMAKE_CURRENT_SOURCE_DIR}/protocols/plasma-window-management.xml
)

qt6_generate_wayland_protocol_client_sources(lxqt-panel-backend-wayland
FILES
${CMAKE_CURRENT_SOURCE_DIR}/protocols/org-kde-plasma-virtual-desktop.xml
)

target_link_libraries(lxqt-panel-backend-wayland
Qt6::GuiPrivate
Qt6::WaylandClient
Qt6::Concurrent
lxqt-panel-backend-common
)
1 change: 1 addition & 0 deletions panel/backends/wayland/lxqtplasmavirtualdesktop.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef LXQTPLASMAVIRTUALDESKTOP_H
#define LXQTPLASMAVIRTUALDESKTOP_H

#include <QTime> // TODO: needed to fix compile errors about QHashPrivate
#include <QVariant>
#include <QtWaylandClient/QWaylandClientExtensionTemplate>

Expand Down
2 changes: 0 additions & 2 deletions panel/backends/wayland/lxqttaskbarplasmawindowmanagment.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#include "lxqttaskbarplasmawindowmanagment.h"

#include <KWindowSystem>

#include <QFuture>
#include <QtConcurrent>
#include <QGuiApplication>
Expand Down
13 changes: 13 additions & 0 deletions panel/backends/xcb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# XCB WM Backend

project(lxqt-panel-backend-xcb)

add_library(lxqt-panel-backend-xcb STATIC
lxqttaskbarbackend_x11.h
lxqttaskbarbackend_x11.cpp
)

target_link_libraries(lxqt-panel-backend-xcb
KF6::WindowSystem
lxqt-panel-backend-common
)

0 comments on commit f6e9ba9

Please sign in to comment.