Compare commits

...

9 Commits

Author SHA1 Message Date
d33befa740 Add a new setExclusiveEdge call in the protocol
This can be used to disambiguate the exclusive edge when the anchors are on a corner (so there would be 2 candidates)
2024-01-18 17:19:25 +01:00
feeea2fec6 braces 2024-01-09 14:31:34 +01:00
b80f22e22f narrower description 2024-01-09 10:04:58 +01:00
74cc364ffe guard with since_version 2024-01-09 10:01:43 +01:00
f90e942ad0 version 5 2024-01-09 09:29:28 +01:00
2334a96555 wrap 2024-01-09 09:27:58 +01:00
a1d225f6ef since 5 2024-01-09 09:25:45 +01:00
8d16787360 Add a description 2024-01-08 17:16:07 +01:00
856843a22f Add a new setExclusiveEdge call in the protocol
This can be used to disambiguate the exclusive edge when the anchors are
on a corner (so there  would be 2 candidates)

it's quite quick and dirty mostly to understand if we do want to push
for something along the lines
2024-01-08 10:36:23 +00:00
5 changed files with 17 additions and 12 deletions

View File

@ -27,7 +27,8 @@ public:
QWindow *parentWindow; QWindow *parentWindow;
QString scope = QStringLiteral("window"); QString scope = QStringLiteral("window");
Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight}; Window::Anchors anchors = {Window::AnchorTop | Window::AnchorBottom | Window::AnchorLeft | Window::AnchorRight};
int32_t exclusionZone = 0; QSize exclusionZone;
Window::Anchor exclusiveEdge = Window::AnchorNone;
Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityOnDemand; Window::KeyboardInteractivity keyboardInteractivity = Window::KeyboardInteractivityOnDemand;
Window::Layer layer = Window::LayerTop; Window::Layer layer = Window::LayerTop;
QMargins margins; QMargins margins;
@ -55,7 +56,7 @@ Window::Anchors Window::anchors() const
return d->anchors; return d->anchors;
} }
void Window::setExclusiveZone(int32_t zone) void Window::setExclusiveZone(const QSize &zone)
{ {
if (d->exclusionZone != zone) { if (d->exclusionZone != zone) {
d->exclusionZone = zone; d->exclusionZone = zone;
@ -63,7 +64,7 @@ void Window::setExclusiveZone(int32_t zone)
} }
} }
int32_t Window::exclusionZone() const QSize Window::exclusionZone() const
{ {
return d->exclusionZone; 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(Anchors anchors READ anchors WRITE setAnchors NOTIFY anchorsChanged)
Q_PROPERTY(QString scope READ scope WRITE setScope) Q_PROPERTY(QString scope READ scope WRITE setScope)
Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged) Q_PROPERTY(QMargins margins READ margins WRITE setMargins NOTIFY marginsChanged)
Q_PROPERTY(qint32 exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged) Q_PROPERTY(QSize exclusionZone READ exclusionZone WRITE setExclusiveZone NOTIFY exclusionZoneChanged)
Q_PROPERTY(Layer layer READ layer WRITE setLayer NOTIFY layerChanged) Q_PROPERTY(Layer layer READ layer WRITE setLayer NOTIFY layerChanged)
Q_PROPERTY(KeyboardInteractivity keyboardInteractivity READ keyboardInteractivity WRITE setKeyboardInteractivity NOTIFY keyboardInteractivityChanged) Q_PROPERTY(KeyboardInteractivity keyboardInteractivity READ keyboardInteractivity WRITE setKeyboardInteractivity NOTIFY keyboardInteractivityChanged)
Q_PROPERTY(ScreenConfiguration screenConfiguration READ screenConfiguration WRITE setScreenConfiguration) Q_PROPERTY(ScreenConfiguration screenConfiguration READ screenConfiguration WRITE setScreenConfiguration)
@ -33,6 +33,7 @@ public:
~Window() override; ~Window() override;
enum Anchor { enum Anchor {
AnchorNone = 0,
AnchorTop = 1, ///< The top edge of the anchor rectangle AnchorTop = 1, ///< The top edge of the anchor rectangle
AnchorBottom = 2, ///< The bottom edge of the anchor rectangle AnchorBottom = 2, ///< The bottom edge of the anchor rectangle
AnchorLeft = 4, ///< The left edge of the anchor rectangle AnchorLeft = 4, ///< The left edge of the anchor rectangle
@ -76,8 +77,8 @@ public:
void setAnchors(Anchors anchor); void setAnchors(Anchors anchor);
Anchors anchors() const; Anchors anchors() const;
void setExclusiveZone(int32_t zone); void setExclusiveZone(const QSize &zone);
int32_t exclusionZone() const; QSize exclusionZone() const;
void setMargins(const QMargins &margins); void setMargins(const QMargins &margins);
QMargins margins() const; QMargins margins() const;
@ -121,6 +122,7 @@ public:
Q_SIGNALS: Q_SIGNALS:
void anchorsChanged(); void anchorsChanged();
void exclusionZoneChanged(); void exclusionZoneChanged();
void exclusiveEdgeChanged();
void marginsChanged(); void marginsChanged();
void keyboardInteractivityChanged(); void keyboardInteractivityChanged();
void layerChanged(); void layerChanged();

View File

@ -122,9 +122,9 @@ void QWaylandLayerSurface::setAnchor(uint anchor)
setWindowGeometry(window()->windowContentGeometry()); setWindowGeometry(window()->windowContentGeometry());
} }
void QWaylandLayerSurface::setExclusiveZone(int32_t zone) void QWaylandLayerSurface::setExclusiveZone(const QSize &zone)
{ {
set_exclusive_zone(zone); set_exclusive_zone(zone.width(), zone.height());
} }
void QWaylandLayerSurface::setMargins(const QMargins &margins) void QWaylandLayerSurface::setMargins(const QMargins &margins)

View File

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

View File

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