mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-15 03:24:26 -04:00
Compare commits
4 Commits
work/david
...
v6.1.2
Author | SHA1 | Date | |
---|---|---|---|
cac5b2eebb | |||
21fd8ca8af | |||
da9fe6c72e | |||
f1a7f99a4a |
@ -4,7 +4,7 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
project(layershellqt)
|
project(layershellqt)
|
||||||
set(PROJECT_VERSION "6.1.80")
|
set(PROJECT_VERSION "6.1.2")
|
||||||
set(PROJECT_VERSION_MAJOR 6)
|
set(PROJECT_VERSION_MAJOR 6)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
|
@ -12,15 +12,12 @@
|
|||||||
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
#include <QtWaylandClient/private/qwaylanddisplay_p.h>
|
||||||
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
#include <QtWaylandClient/private/qwaylandwindow_p.h>
|
||||||
|
|
||||||
#include <QPlatformSurfaceEvent>
|
|
||||||
|
|
||||||
namespace LayerShellQt
|
namespace LayerShellQt
|
||||||
{
|
{
|
||||||
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration()
|
QWaylandLayerShellIntegration::QWaylandLayerShellIntegration()
|
||||||
: QWaylandShellIntegrationTemplate<QWaylandLayerShellIntegration>(5)
|
: QWaylandShellIntegrationTemplate<QWaylandLayerShellIntegration>(5)
|
||||||
, m_xdgActivation(new QWaylandXdgActivationV1)
|
, m_xdgActivation(new QWaylandXdgActivationV1)
|
||||||
{
|
{
|
||||||
qGuiApp->installEventFilter(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QWaylandLayerShellIntegration::~QWaylandLayerShellIntegration()
|
QWaylandLayerShellIntegration::~QWaylandLayerShellIntegration()
|
||||||
@ -35,29 +32,4 @@ QtWaylandClient::QWaylandShellSurface *QWaylandLayerShellIntegration::createShel
|
|||||||
return new QWaylandLayerSurface(this, window);
|
return new QWaylandLayerSurface(this, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool QWaylandLayerShellIntegration::eventFilter(QObject *watched, QEvent *event)
|
|
||||||
{
|
|
||||||
if (event->type() == QEvent::PlatformSurface && static_cast<QPlatformSurfaceEvent *>(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
|
|
||||||
QWindow *window = qobject_cast<QWindow *>(watched);
|
|
||||||
if (!window) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
auto child = static_cast<QtWaylandClient::QWaylandWindow *>(window->handle());
|
|
||||||
auto maybeSetParent = [child]() {
|
|
||||||
auto transientParent = child->window()->transientParent();
|
|
||||||
if (!transientParent) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (auto layerParent = qobject_cast<QWaylandLayerSurface *>(static_cast<QtWaylandClient::QWaylandWindow *>(transientParent->handle())->shellSurface())) {
|
|
||||||
if (auto topevel = child->surfaceRole<xdg_toplevel>()) {
|
|
||||||
layerParent->set_parent_of(topevel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
maybeSetParent();
|
|
||||||
connect(window, &QWindow::transientParentChanged, child, maybeSetParent);
|
|
||||||
connect(child, &QtWaylandClient::QWaylandWindow::surfaceRoleCreated, this, maybeSetParent);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@ public:
|
|||||||
QtWaylandClient::QWaylandShellSurface *createShellSurface(QtWaylandClient::QWaylandWindow *window) override;
|
QtWaylandClient::QWaylandShellSurface *createShellSurface(QtWaylandClient::QWaylandWindow *window) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool eventFilter(QObject *watched, QEvent *event) override;
|
|
||||||
QScopedPointer<QWaylandXdgActivationV1> m_xdgActivation;
|
QScopedPointer<QWaylandXdgActivationV1> m_xdgActivation;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -110,13 +110,9 @@ void QWaylandLayerSurface::attachPopup(QtWaylandClient::QWaylandShellSurface *po
|
|||||||
|
|
||||||
void QWaylandLayerSurface::applyConfigure()
|
void QWaylandLayerSurface::applyConfigure()
|
||||||
{
|
{
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
m_configuring = true;
|
m_configuring = true;
|
||||||
#endif
|
|
||||||
window()->resizeFromApplyConfigure(m_pendingSize);
|
window()->resizeFromApplyConfigure(m_pendingSize);
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
m_configuring = false;
|
m_configuring = false;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
void QWaylandLayerSurface::setDesiredSize(const QSize &size)
|
||||||
@ -167,7 +163,6 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
|
|||||||
set_layer(layer);
|
set_layer(layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
||||||
{
|
{
|
||||||
if (m_configuring) {
|
if (m_configuring) {
|
||||||
@ -176,12 +171,6 @@ void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
|||||||
|
|
||||||
setDesiredSize(geometry.size());
|
setDesiredSize(geometry.size());
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
void QWaylandLayerSurface::setWindowSize(const QSize &size)
|
|
||||||
{
|
|
||||||
setDesiredSize(size);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool QWaylandLayerSurface::requestActivate()
|
bool QWaylandLayerSurface::requestActivate()
|
||||||
{
|
{
|
||||||
|
@ -43,11 +43,7 @@ public:
|
|||||||
void setLayer(uint32_t layer);
|
void setLayer(uint32_t layer);
|
||||||
|
|
||||||
void applyConfigure() override;
|
void applyConfigure() override;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
void setWindowGeometry(const QRect &geometry) override;
|
void setWindowGeometry(const QRect &geometry) override;
|
||||||
#else
|
|
||||||
void setWindowSize(const QSize &size) override;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool requestActivate() override;
|
bool requestActivate() override;
|
||||||
void setXdgActivationToken(const QString &token) override;
|
void setXdgActivationToken(const QString &token) override;
|
||||||
@ -65,9 +61,7 @@ private:
|
|||||||
QString m_activationToken;
|
QString m_activationToken;
|
||||||
|
|
||||||
bool m_configured = false;
|
bool m_configured = false;
|
||||||
#if QT_VERSION < QT_VERSION_CHECK(6, 9, 0)
|
|
||||||
bool m_configuring = false;
|
bool m_configuring = false;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -403,11 +403,5 @@
|
|||||||
</description>
|
</description>
|
||||||
<arg name="edge" type="uint"/>
|
<arg name="edge" type="uint"/>
|
||||||
</request>
|
</request>
|
||||||
|
|
||||||
<request name="set_parent_of">
|
|
||||||
<description summary="assign this layer_surface as an xdg_toplevel parent">
|
|
||||||
</description>
|
|
||||||
<arg name="toplevel" type="object" interface="xdg_toplevel" />
|
|
||||||
</request>
|
|
||||||
</interface>
|
</interface>
|
||||||
</protocol>
|
</protocol>
|
||||||
|
Reference in New Issue
Block a user