Compare commits

..

3 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
078f36f8f3 Update version number for 5.92.0
GIT_SILENT
2024-01-10 12:29:03 +00:00
6 changed files with 39 additions and 19 deletions

View File

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

View File

@ -27,8 +27,7 @@ public:
QWindow *parentWindow;
QString scope = QStringLiteral("window");
Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight};
QSize exclusionZone;
Window::Anchor exclusiveEdge = Window::AnchorNone;
int32_t exclusionZone = 0;
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityOnDemand;
Window::Layer layer = Window::LayerTop;
QMargins margins;
@ -56,7 +55,7 @@ Window::Anchors Window::anchors() const
return d->anchors;
}
void Window::setExclusiveZone(const QSize &zone)
void Window::setExclusiveZone(int32_t zone)
{
if (d->exclusionZone != zone) {
d->exclusionZone = zone;
@ -64,7 +63,7 @@ void Window::setExclusiveZone(const QSize &zone)
}
}
QSize Window::exclusionZone() const
int32_t Window::exclusionZone() const
{
return d->exclusionZone;
}

View File

@ -24,7 +24,7 @@ class LAYERSHELLQT_EXPORT Window : public QObject
Q_PROPERTY(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged)
Q_PROPERTY(QString scope READ scope WRITE setScope)
Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
Q_PROPERTY(QSize exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
Q_PROPERTY(qint32 exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
Q_PROPERTY(Layer layer READ layer WRITE setLayer NOTIFY layerChanged)
Q_PROPERTY(KeyboardInteractivity keyboardInteractivity READ keyboardInteractivity WRITE setKeyboardInteractivity NOTIFY keyboardInteractivityChanged)
Q_PROPERTY(ScreenConfiguration screenConfiguration READ screenConfiguration WRITE setScreenConfiguration)
@ -33,7 +33,6 @@ public:
~Window() override;
enum Anchor {
AnchorNone = 0,
AnchorTop = 1, ///< The top edge of the anchor rectangle
AnchorBottom = 2, ///< The bottom edge of the anchor rectangle
AnchorLeft = 4, ///< The left edge of the anchor rectangle
@ -77,8 +76,8 @@ public:
void setAnchors(Anchors anchor);
Anchors anchors() const;
void setExclusiveZone(const QSize &zone);
QSize exclusionZone() const;
void setExclusiveZone(int32_t zone);
int32_t exclusionZone() const;
void setMargins(const QMargins &margins);
QMargins margins() const;
@ -122,7 +121,6 @@ public:
Q_SIGNALS:
void anchorsChanged();
void exclusionZoneChanged();
void exclusiveEdgeChanged();
void marginsChanged();
void keyboardInteractivityChanged();
void layerChanged();

View File

@ -16,6 +16,31 @@
#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
{
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) {
m_configured = true;
window()->resizeFromApplyConfigure(m_pendingSize);
window()->handleExpose(QRect(QPoint(), m_pendingSize));
ExposeHelper helper(window(), m_pendingSize);
} else {
// Later configures are resizes, so we have to queue them up for a time when we
// are not painting to the window.
@ -122,9 +147,9 @@ void QWaylandLayerSurface::setAnchor(uint anchor)
setWindowGeometry(window()->windowContentGeometry());
}
void QWaylandLayerSurface::setExclusiveZone(const QSize &zone)
void QWaylandLayerSurface::setExclusiveZone(int32_t zone)
{
set_exclusive_zone(zone.width(), zone.height());
set_exclusive_zone(zone);
}
void QWaylandLayerSurface::setMargins(const QMargins &margins)

View File

@ -35,7 +35,7 @@ public:
void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override;
void setAnchor(uint32_t anchor);
void setExclusiveZone(const QSize &zone);
void setExclusiveZone(int32_t zone);
void setMargins(const QMargins &margins);
void setKeyboardInteractivity(uint32_t interactivity);
void setLayer(uint32_t layer);

View File

@ -25,7 +25,7 @@
THIS SOFTWARE.
</copyright>
<interface name="zwlr_layer_shell_v1" version="5">
<interface name="zwlr_layer_shell_v1" version="4">
<description summary="create surfaces that are layers of the desktop">
Clients can use this interface to assign the surface_layer role to
wl_surfaces. Such surfaces are assigned to a "layer" of the output and
@ -100,7 +100,7 @@
</request>
</interface>
<interface name="zwlr_layer_surface_v1" version="5">
<interface name="zwlr_layer_surface_v1" version="4">
<description summary="layer metadata interface">
An interface that may be implemented by a wl_surface, for surfaces that
are designed to be rendered as a layer of a stacked desktop-like
@ -184,8 +184,7 @@
Exclusive zone is double-buffered, see wl_surface.commit.
</description>
<arg name="horizontal_zone" type="int"/>
<arg name="vertical_zone" type="int"/>
<arg name="zone" type="int"/>
</request>
<request name="set_margin">
@ -387,6 +386,5 @@
</description>
<arg name="layer" type="uint" enum="zwlr_layer_shell_v1.layer" summary="layer to move this surface to"/>
</request>
</interface>
</protocol>