mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-05-25 09:30:22 -04:00
parent
f1e50306f8
commit
b8a9938c0d
@ -16,6 +16,31 @@
|
|||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
template<typename T>
|
||||||
|
concept QWaylandWindowNewV6Type = requires(T t) { t.sendRecursiveExposeEvent(); };
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
concept QWaylandWindowOldV6Type = requires(T t) { t.handleExpose(QRect()); } && !requires(T t) { t.sendRecursiveExposeEvent(); };
|
||||||
|
|
||||||
|
class ExposeHelper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template<QWaylandWindowOldV6Type T>
|
||||||
|
[[maybe_unused]] ExposeHelper(T *window, const QSize &pendingSize)
|
||||||
|
{
|
||||||
|
window->handleExpose(QRect(QPoint(), pendingSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
template<QWaylandWindowNewV6Type T>
|
||||||
|
[[maybe_unused]] ExposeHelper(T *window, [[maybe_unused]] const QSize &pendingSize)
|
||||||
|
{
|
||||||
|
window->sendRecursiveExposeEvent();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
namespace LayerShellQt
|
namespace LayerShellQt
|
||||||
{
|
{
|
||||||
QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, QtWaylandClient::QWaylandWindow *window)
|
QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell, QtWaylandClient::QWaylandWindow *window)
|
||||||
@ -92,7 +117,7 @@ void QWaylandLayerSurface::zwlr_layer_surface_v1_configure(uint32_t serial, uint
|
|||||||
if (!m_configured) {
|
if (!m_configured) {
|
||||||
m_configured = true;
|
m_configured = true;
|
||||||
window()->resizeFromApplyConfigure(m_pendingSize);
|
window()->resizeFromApplyConfigure(m_pendingSize);
|
||||||
window()->handleExpose(QRect(QPoint(), m_pendingSize));
|
ExposeHelper helper(window(), m_pendingSize);
|
||||||
} else {
|
} else {
|
||||||
// Later configures are resizes, so we have to queue them up for a time when we
|
// Later configures are resizes, so we have to queue them up for a time when we
|
||||||
// are not painting to the window.
|
// are not painting to the window.
|
||||||
|
Loading…
Reference in New Issue
Block a user