mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2026-04-01 17:32:42 -04:00
Compare commits
7 Commits
v6.6.3
...
work/zzag/
| Author | SHA1 | Date | |
|---|---|---|---|
| 20c9182836 | |||
| aac600107a | |||
| 9c02b52291 | |||
| 15f108b536 | |||
| dd76feea81 | |||
| 430ad3630f | |||
| 68df285294 |
@ -4,7 +4,7 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(layershellqt)
|
||||
set(PROJECT_VERSION "6.6.3")
|
||||
set(PROJECT_VERSION "6.6.80")
|
||||
set(PROJECT_VERSION_MAJOR 6)
|
||||
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
@ -37,7 +37,7 @@ include(ECMGenerateExportHeader)
|
||||
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS WaylandClient Qml)
|
||||
|
||||
if (Qt6WaylandClient_VERSION VERSION_GREATER_EQUAL "6.10.0")
|
||||
find_package(Qt6WaylandClientPrivate ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE)
|
||||
find_package(Qt6WaylandClientPrivate ${QT_MIN_VERSION} REQUIRED NO_MODULE)
|
||||
endif()
|
||||
|
||||
find_package(WaylandScanner REQUIRED)
|
||||
|
||||
@ -7,11 +7,8 @@ add_library(LayerShellQtInterface)
|
||||
|
||||
qt6_extract_metatypes(LayerShellQtInterface)
|
||||
|
||||
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
|
||||
set(private_code_option "PRIVATE_CODE")
|
||||
endif()
|
||||
qt6_generate_wayland_protocol_client_sources(LayerShellQtInterface
|
||||
${private_code_option}
|
||||
PRIVATE_CODE
|
||||
FILES
|
||||
${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
|
||||
${WaylandProtocols_DATADIR}/staging/xdg-activation/xdg-activation-v1.xml
|
||||
|
||||
@ -133,6 +133,7 @@ void QWaylandLayerSurface::applyConfigure()
|
||||
window()->resizeFromApplyConfigure(m_pendingSize);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 12, 0)
|
||||
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
||||
{
|
||||
const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight});
|
||||
@ -147,6 +148,22 @@ void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
||||
}
|
||||
set_size(effectiveSize.width(), effectiveSize.height());
|
||||
}
|
||||
#else
|
||||
void QWaylandLayerSurface::setDesiredSize(const QSizeF &size)
|
||||
{
|
||||
const bool horizontallyConstrained = m_interface->anchors().testFlags({Window::AnchorLeft, Window::AnchorRight});
|
||||
const bool verticallyConstrained = m_interface->anchors().testFlags({Window::AnchorTop, Window::AnchorBottom});
|
||||
|
||||
QSize effectiveSize = size.toSize();
|
||||
if (horizontallyConstrained) {
|
||||
effectiveSize.setWidth(0);
|
||||
}
|
||||
if (verticallyConstrained) {
|
||||
effectiveSize.setHeight(0);
|
||||
}
|
||||
set_size(effectiveSize.width(), effectiveSize.height());
|
||||
}
|
||||
#endif
|
||||
|
||||
void QWaylandLayerSurface::setAnchor(uint anchor)
|
||||
{
|
||||
@ -181,7 +198,11 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
|
||||
set_layer(layer);
|
||||
}
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 12, 0)
|
||||
void QWaylandLayerSurface::setWindowSize(const QSize &size)
|
||||
#else
|
||||
void QWaylandLayerSurface::setWindowSize(const QSizeF &size)
|
||||
#endif
|
||||
{
|
||||
if (m_interface->desiredSize().isNull()) {
|
||||
setDesiredSize(size);
|
||||
@ -204,7 +225,7 @@ bool QWaylandLayerSurface::requestActivate()
|
||||
return true;
|
||||
} else {
|
||||
const auto focusWindow = QGuiApplication::focusWindow();
|
||||
const auto wlWindow = focusWindow ? static_cast<QtWaylandClient::QWaylandWindow *>(focusWindow->handle()) : window();
|
||||
const auto wlWindow = focusWindow && focusWindow->handle() ? static_cast<QtWaylandClient::QWaylandWindow *>(focusWindow->handle()) : window();
|
||||
if (const auto seat = wlWindow->display()->lastInputDevice()) {
|
||||
const auto tokenProvider = activation->requestXdgActivationToken(wlWindow->display(), wlWindow->wlSurface(), seat->serial(), QString());
|
||||
connect(tokenProvider, &QWaylandXdgActivationTokenV1::done, this, [this](const QString &token) {
|
||||
|
||||
@ -34,7 +34,11 @@ public:
|
||||
}
|
||||
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 12, 0)
|
||||
void setDesiredSize(const QSize &size);
|
||||
#else
|
||||
void setDesiredSize(const QSizeF &size);
|
||||
#endif
|
||||
void setAnchor(uint32_t anchor);
|
||||
void setExclusiveZone(int32_t zone);
|
||||
void setExclusiveEdge(uint32_t edge);
|
||||
@ -43,7 +47,11 @@ public:
|
||||
void setLayer(uint32_t layer);
|
||||
|
||||
void applyConfigure() override;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 12, 0)
|
||||
void setWindowSize(const QSize &size) override;
|
||||
#else
|
||||
void setWindowSize(const QSizeF &size) override;
|
||||
#endif
|
||||
|
||||
bool requestActivate() override;
|
||||
bool requestActivateOnShow() override;
|
||||
|
||||
Reference in New Issue
Block a user