Compare commits

...

2 Commits

Author SHA1 Message Date
b8a9938c0d Fix build with Qt6.8
handleExpose was removed in 20fb0e7dd5
2024-02-08 17:50:21 +08:00
f1e50306f8 Update version number for 6.0.80
GIT_SILENT
2024-01-10 14:04:04 +00:00
2 changed files with 27 additions and 2 deletions

View File

@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.16) cmake_minimum_required(VERSION 3.16)
project(layershellqt) project(layershellqt)
set(PROJECT_VERSION "5.92.0") set(PROJECT_VERSION "6.0.80")
set(PROJECT_VERSION_MAJOR 6) set(PROJECT_VERSION_MAJOR 6)
set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD 99)

View File

@ -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.