mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-14 02:54:31 -04:00
Compare commits
9 Commits
v5.23.4
...
work/zzag/
Author | SHA1 | Date | |
---|---|---|---|
826c3e3ce0 | |||
3214fb588f | |||
8c39cad0ba | |||
80f6a629bb | |||
662afeba22 | |||
3dac2dd012 | |||
5b280a4602 | |||
eb6fb8ab13 | |||
06815f2817 |
6
.gitlab-ci.yml
Normal file
6
.gitlab-ci.yml
Normal file
@ -0,0 +1,6 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
include:
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
|
||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
|
7
.kde-ci.yml
Normal file
7
.kde-ci.yml
Normal file
@ -0,0 +1,7 @@
|
||||
# SPDX-FileCopyrightText: None
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
Dependencies:
|
||||
- 'on': ['@all']
|
||||
'require':
|
||||
'frameworks/extra-cmake-modules': '@latest'
|
@ -4,20 +4,19 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(layershellqt)
|
||||
set(PROJECT_VERSION "5.22.90")
|
||||
set(PROJECT_VERSION_MAJOR 5)
|
||||
set(PROJECT_VERSION "6.0.0")
|
||||
set(PROJECT_VERSION_MAJOR 6)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
||||
set(QT_MIN_VERSION "5.15.0")
|
||||
set(KF5_MIN_VERSION "5.82")
|
||||
set(QT_MIN_VERSION "6.2.0")
|
||||
set(KF5_MIN_VERSION "5.86")
|
||||
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
||||
find_package(Qt5XkbCommonSupport REQUIRED PRIVATE)
|
||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
||||
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
|
||||
|
||||
@ -38,8 +37,6 @@ find_package(Wayland 1.3 COMPONENTS Client Server)
|
||||
find_package(WaylandProtocols)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
pkg_check_modules(XKBCOMMON xkbcommon REQUIRED IMPORTED_TARGET)
|
||||
|
||||
set_package_properties(Wayland PROPERTIES
|
||||
TYPE REQUIRED)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu90")
|
||||
|
@ -4,6 +4,6 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(Qt5Gui "@QT_MIN_VERSION@")
|
||||
find_dependency(Qt6Gui "@QT_MIN_VERSION@")
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/LayerShellQtTargets.cmake")
|
||||
|
@ -16,7 +16,7 @@ ecm_qt_declare_logging_category(LAYER_SHELL_SOURCES
|
||||
)
|
||||
|
||||
add_library(LayerShellQtInterface SHARED qwaylandlayersurface.cpp interfaces/window.cpp interfaces/shell.cpp qwaylandlayershellintegration.cpp qwaylandlayershell.cpp ${LAYER_SHELL_SOURCES})
|
||||
target_link_libraries(LayerShellQtInterface PRIVATE Qt::Gui Qt::WaylandClientPrivate Qt::XkbCommonSupportPrivate Wayland::Client PkgConfig::XKBCOMMON)
|
||||
target_link_libraries(LayerShellQtInterface PRIVATE Qt::Gui Qt::WaylandClientPrivate Wayland::Client)
|
||||
target_include_directories(LayerShellQtInterface PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/LayerShellQt>"
|
||||
INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}/>"
|
||||
)
|
||||
@ -27,7 +27,7 @@ set_target_properties(LayerShellQtInterface PROPERTIES VERSION ${LAYERSHELLQT_
|
||||
)
|
||||
|
||||
add_library(layer-shell SHARED qwaylandlayershellintegrationplugin.cpp)
|
||||
target_link_libraries(layer-shell LayerShellQtInterface Qt::WaylandClient Qt::WaylandClientPrivate Qt::XkbCommonSupportPrivate Wayland::Client PkgConfig::XKBCOMMON)
|
||||
target_link_libraries(layer-shell LayerShellQtInterface Qt::WaylandClient Qt::WaylandClientPrivate Wayland::Client)
|
||||
|
||||
ecm_generate_headers(LayerShellQt_HEADERS
|
||||
HEADER_NAMES
|
||||
|
@ -21,7 +21,7 @@ class LAYERSHELLQT_EXPORT QWaylandLayerShell : public QtWayland::zwlr_layer_shel
|
||||
{
|
||||
public:
|
||||
QWaylandLayerShell(::wl_registry *registry, uint32_t id, uint32_t version);
|
||||
virtual ~QWaylandLayerShell();
|
||||
~QWaylandLayerShell() override;
|
||||
|
||||
QWaylandLayerSurface *createLayerSurface(QtWaylandClient::QWaylandWindow *window);
|
||||
// TODO: Popups
|
||||
|
@ -22,26 +22,30 @@ QWaylandLayerShellIntegration::~QWaylandLayerShellIntegration()
|
||||
{
|
||||
}
|
||||
|
||||
bool QWaylandLayerShellIntegration::initialize(QtWaylandClient::QWaylandDisplay *display)
|
||||
bool QWaylandLayerShellIntegration::initialize()
|
||||
{
|
||||
QWaylandShellIntegration::initialize(display);
|
||||
display->addRegistryListener(registryLayer, this);
|
||||
return m_layerShell != nullptr;
|
||||
if (m_layerShell) {
|
||||
return true;
|
||||
}
|
||||
wl_registry *registry;
|
||||
uint32_t id;
|
||||
uint32_t version;
|
||||
const bool found = findGlobal(QLatin1String("zwlr_layer_shell_v1"), ®istry, &id, &version);
|
||||
if (!found) {
|
||||
qWarning() << "Could not find the zwlr_layer_shell_v1 global. Compositor does not support the layer shell protocol?";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_layerShell.reset(new QWaylandLayerShell(registry, id, std::min(version, 4u)));
|
||||
return true;
|
||||
}
|
||||
|
||||
QtWaylandClient::QWaylandShellSurface *QWaylandLayerShellIntegration::createShellSurface(QtWaylandClient::QWaylandWindow *window)
|
||||
{
|
||||
return m_layerShell->createLayerSurface(window);
|
||||
}
|
||||
|
||||
void QWaylandLayerShellIntegration::registryLayer(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version)
|
||||
{
|
||||
QWaylandLayerShellIntegration *shell = static_cast<QWaylandLayerShellIntegration *>(data);
|
||||
|
||||
if (interface == zwlr_layer_shell_v1_interface.name)
|
||||
shell->m_layerShell.reset(new QWaylandLayerShell(registry, id, std::min(version, 4u)));
|
||||
if (m_layerShell) {
|
||||
return m_layerShell->createLayerSurface(window);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//#include "qwaylandlayershellintegration.moc"
|
||||
|
@ -8,10 +8,9 @@
|
||||
#ifndef _LAYERSHELLINTEGRATION_P_H
|
||||
#define _LAYERSHELLINTEGRATION_P_H
|
||||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "layershellqt_export.h"
|
||||
#include <QtWaylandClient/private/qwaylandshellintegration_p.h>
|
||||
|
||||
#include <QtWaylandClient/private/qwaylandclientshellapi_p.h>
|
||||
|
||||
namespace LayerShellQt
|
||||
{
|
||||
@ -23,12 +22,10 @@ public:
|
||||
QWaylandLayerShellIntegration();
|
||||
~QWaylandLayerShellIntegration() override;
|
||||
|
||||
bool initialize(QtWaylandClient::QWaylandDisplay *display) override;
|
||||
bool initialize() override;
|
||||
QtWaylandClient::QWaylandShellSurface *createShellSurface(QtWaylandClient::QWaylandWindow *window) override;
|
||||
|
||||
private:
|
||||
static void registryLayer(void *data, struct wl_registry *registry, uint32_t id, const QString &interface, uint32_t version);
|
||||
|
||||
QScopedPointer<QWaylandLayerShell> m_layerShell;
|
||||
};
|
||||
|
||||
|
@ -23,7 +23,7 @@ class LAYERSHELLQT_EXPORT QWaylandLayerSurface : public QtWaylandClient::QWaylan
|
||||
Q_OBJECT
|
||||
public:
|
||||
QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandClient::QWaylandWindow *window);
|
||||
virtual ~QWaylandLayerSurface();
|
||||
~QWaylandLayerSurface() override;
|
||||
|
||||
bool isExposed() const override
|
||||
{
|
||||
|
Reference in New Issue
Block a user