mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-15 03:24:26 -04:00
Compare commits
20 Commits
work/david
...
v5.27.8
Author | SHA1 | Date | |
---|---|---|---|
a09d4c532d | |||
ee7ccc4fb8 | |||
d610813bac | |||
debc455bd5 | |||
b2dcb1acff | |||
94eb90d823 | |||
dac784828f | |||
ddc4aead87 | |||
7a862bdcd4 | |||
b758105bd7 | |||
79441811ff | |||
fc06e945c8 | |||
b95910c086 | |||
70dc87f673 | |||
7b9c2c1db1 | |||
9b5a39922b | |||
91db77acc2 | |||
5af50ac3ee | |||
7bfac45da8 | |||
7bd63669ea |
@ -2,6 +2,8 @@
|
|||||||
# SPDX-License-Identifier: CC0-1.0
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
include:
|
include:
|
||||||
|
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/reuse-lint.yml
|
||||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux.yml
|
- 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
|
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd.yml
|
||||||
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
|
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/linux-qt6.yml
|
||||||
|
- https://invent.kde.org/sysadmin/ci-utilities/raw/master/gitlab-templates/freebsd-qt6.yml
|
||||||
|
@ -4,13 +4,13 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(layershellqt)
|
project(layershellqt)
|
||||||
set(PROJECT_VERSION "5.25.80")
|
set(PROJECT_VERSION "5.27.8")
|
||||||
set(PROJECT_VERSION_MAJOR 5)
|
set(PROJECT_VERSION_MAJOR 5)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
|
||||||
set(QT_MIN_VERSION "5.15.2")
|
set(QT_MIN_VERSION "5.15.2")
|
||||||
set(KF5_MIN_VERSION "5.94")
|
set(KF5_MIN_VERSION "5.102.0")
|
||||||
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
|
||||||
|
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
@ -23,6 +23,7 @@ include(KDEInstallDirs)
|
|||||||
include(KDECMakeSettings)
|
include(KDECMakeSettings)
|
||||||
include(KDECompilerSettings NO_POLICY_SCOPE)
|
include(KDECompilerSettings NO_POLICY_SCOPE)
|
||||||
include(ECMSetupVersion)
|
include(ECMSetupVersion)
|
||||||
|
include(ECMDeprecationSettings)
|
||||||
include(ECMGenerateHeaders)
|
include(ECMGenerateHeaders)
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
include(FeatureSummary)
|
include(FeatureSummary)
|
||||||
@ -30,6 +31,7 @@ include(GenerateExportHeader)
|
|||||||
include(KDEClangFormat)
|
include(KDEClangFormat)
|
||||||
include(ECMQtDeclareLoggingCategory)
|
include(ECMQtDeclareLoggingCategory)
|
||||||
|
|
||||||
|
|
||||||
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
||||||
if (QT_MAJOR_VERSION EQUAL "5")
|
if (QT_MAJOR_VERSION EQUAL "5")
|
||||||
find_package(Qt5XkbCommonSupport REQUIRED PRIVATE)
|
find_package(Qt5XkbCommonSupport REQUIRED PRIVATE)
|
||||||
@ -53,10 +55,15 @@ ecm_setup_version(${PROJECT_VERSION} VARIABLE_PREFIX LAYERSHELLQT
|
|||||||
|
|
||||||
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
|
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
|
||||||
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
|
||||||
|
|
||||||
|
ecm_set_disabled_deprecation_versions(QT 5.15.2
|
||||||
|
KF 5.101
|
||||||
|
)
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
|
|
||||||
set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_LIBDIR}/cmake/LayerShellQt)
|
set(CMAKECONFIG_INSTALL_DIR ${KDE_INSTALL_CMAKEPACKAGEDIR}/LayerShellQt)
|
||||||
install(EXPORT LayerShellQtTargets
|
install(EXPORT LayerShellQtTargets
|
||||||
NAMESPACE LayerShellQt::
|
NAMESPACE LayerShellQt::
|
||||||
DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
DESTINATION ${CMAKECONFIG_INSTALL_DIR}
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
# SPDX-FileCopyrightText: None
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
maintainer:
|
maintainer:
|
||||||
- vladz
|
- vladz
|
||||||
description: Layer Shell Qt
|
description: Layer Shell Qt
|
||||||
|
@ -5,11 +5,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
#include "../qwaylandlayersurface_p.h"
|
|
||||||
#include "../qwaylandlayershellintegration_p.h"
|
|
||||||
#include <layershellqt_logging.h>
|
#include <layershellqt_logging.h>
|
||||||
#include <private/qwaylandshellsurface_p.h>
|
|
||||||
#include <private/qwaylandwindow_p.h>
|
#include <QPointer>
|
||||||
|
#include <optional>
|
||||||
|
|
||||||
using namespace LayerShellQt;
|
using namespace LayerShellQt;
|
||||||
|
|
||||||
@ -28,7 +27,7 @@ public:
|
|||||||
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityExclusive;
|
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityExclusive;
|
||||||
Window::Layer layer = Window::LayerTop;
|
Window::Layer layer = Window::LayerTop;
|
||||||
QMargins margins;
|
QMargins margins;
|
||||||
QPointer<QScreen> desiredOutput;
|
std::optional<QPointer<QScreen>> desiredOutput;
|
||||||
};
|
};
|
||||||
|
|
||||||
static QMap<QWindow *, Window *> s_map;
|
static QMap<QWindow *, Window *> s_map;
|
||||||
@ -105,7 +104,12 @@ Window::Layer Window::layer() const
|
|||||||
|
|
||||||
QScreen *Window::desiredOutput() const
|
QScreen *Window::desiredOutput() const
|
||||||
{
|
{
|
||||||
return d->desiredOutput;
|
// Don't use .value_or here to avoid a temporary QPointer
|
||||||
|
if (d->desiredOutput.has_value()) {
|
||||||
|
return d->desiredOutput.value();
|
||||||
|
}
|
||||||
|
|
||||||
|
return d->parentWindow->screen();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setDesiredOutput(QScreen *output)
|
void Window::setDesiredOutput(QScreen *output)
|
||||||
@ -118,23 +122,6 @@ Window::Window(QWindow *window)
|
|||||||
, d(new WindowPrivate(window))
|
, d(new WindowPrivate(window))
|
||||||
{
|
{
|
||||||
s_map.insert(d->parentWindow, this);
|
s_map.insert(d->parentWindow, this);
|
||||||
|
|
||||||
//BEGIN Compat mode
|
|
||||||
window->winId();
|
|
||||||
window->setFlag(Qt::BypassWindowManagerHint);
|
|
||||||
|
|
||||||
auto ww = dynamic_cast<QtWaylandClient::QWaylandWindow *>(d->parentWindow->handle());
|
|
||||||
if (!ww) {
|
|
||||||
qCDebug(LAYERSHELLQT) << "window not a wayland window" << d->parentWindow;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QWaylandLayerShellIntegration shellIntegration;
|
|
||||||
shellIntegration.initialize(ww->display());
|
|
||||||
shellIntegration.createShellSurface(ww);
|
|
||||||
// we can't block for configure events
|
|
||||||
// a round trip should mean we'll have one by the time we attach the buffer
|
|
||||||
ww->display()->forceRoundTrip();
|
|
||||||
//END compat mode
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Window *Window::get(QWindow *window)
|
Window *Window::get(QWindow *window)
|
||||||
|
@ -37,7 +37,7 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandC
|
|||||||
}
|
}
|
||||||
init(shell->get_layer_surface(window->waylandSurface()->object(), output, interface->layer(), interface->scope()));
|
init(shell->get_layer_surface(window->waylandSurface()->object(), output, interface->layer(), interface->scope()));
|
||||||
connect(interface, &Window::layerChanged, this, [this, interface]() {
|
connect(interface, &Window::layerChanged, this, [this, interface]() {
|
||||||
set_layer(interface->layer());
|
setLayer(interface->layer());
|
||||||
});
|
});
|
||||||
|
|
||||||
set_anchor(interface->anchors());
|
set_anchor(interface->anchors());
|
||||||
|
@ -51,8 +51,7 @@ class BasicWindow : public QRasterWindow
|
|||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
// Shell::useLayerShell();
|
Shell::useLayerShell();
|
||||||
qputenv("QT_WAYLAND_USE_BYPASSWINDOWMANAGERHINT", "1");
|
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user