@@ -71,21 +71,17 @@ bool WlrLayershell::deleteOnInvisible() const {
7171 return true ;
7272}
7373
74- void WlrLayershell::setWidth (qint32 width) {
75- this ->mWidth = width;
76-
74+ void WlrLayershell::trySetWidth (qint32 implicitWidth) {
7775 // only update the actual size if not blocked by anchors
7876 if (!this ->ext ->anchors ().horizontalConstraint ()) {
79- this ->ProxyWindowBase ::setWidth (width );
77+ this ->ProxyWindowBase ::trySetWidth (implicitWidth );
8078 }
8179}
8280
83- void WlrLayershell::setHeight (qint32 height) {
84- this ->mHeight = height;
85-
81+ void WlrLayershell::trySetHeight (qint32 implicitHeight) {
8682 // only update the actual size if not blocked by anchors
8783 if (!this ->ext ->anchors ().verticalConstraint ()) {
88- this ->ProxyWindowBase ::setHeight (height );
84+ this ->ProxyWindowBase ::trySetHeight (implicitHeight );
8985 }
9086}
9187
@@ -108,10 +104,11 @@ Anchors WlrLayershell::anchors() const { return this->ext->anchors(); }
108104
109105void WlrLayershell::setAnchors (Anchors anchors) {
110106 this ->ext ->setAnchors (anchors);
107+ if (!this ->window ) return ;
111108
112109 // explicitly set width values are tracked so the entire screen isn't covered if an anchor is removed.
113- if (!anchors.horizontalConstraint ()) this ->ProxyWindowBase ::setWidth (this ->mWidth );
114- if (!anchors.verticalConstraint ()) this ->ProxyWindowBase ::setHeight (this ->mHeight );
110+ if (!anchors.horizontalConstraint ()) this ->ProxyWindowBase ::trySetWidth (this ->implicitWidth () );
111+ if (!anchors.verticalConstraint ()) this ->ProxyWindowBase ::trySetHeight (this ->implicitHeight () );
115112}
116113
117114bool WlrLayershell::aboveWindows () const { return this ->layer () > WlrLayer::Bottom; }
@@ -190,6 +187,8 @@ WaylandPanelInterface::WaylandPanelInterface(QObject* parent)
190187 QObject::connect (this ->layer , &ProxyWindowBase::windowConnected, this , &WaylandPanelInterface::windowConnected);
191188 QObject::connect (this ->layer , &ProxyWindowBase::visibleChanged, this , &WaylandPanelInterface::visibleChanged);
192189 QObject::connect (this ->layer , &ProxyWindowBase::backerVisibilityChanged, this , &WaylandPanelInterface::backingWindowVisibleChanged);
190+ QObject::connect (this ->layer , &ProxyWindowBase::implicitHeightChanged, this , &WaylandPanelInterface::implicitHeightChanged);
191+ QObject::connect (this ->layer , &ProxyWindowBase::implicitWidthChanged, this , &WaylandPanelInterface::implicitWidthChanged);
193192 QObject::connect (this ->layer , &ProxyWindowBase::heightChanged, this , &WaylandPanelInterface::heightChanged);
194193 QObject::connect (this ->layer , &ProxyWindowBase::widthChanged, this , &WaylandPanelInterface::widthChanged);
195194 QObject::connect (this ->layer , &ProxyWindowBase::devicePixelRatioChanged, this , &WaylandPanelInterface::devicePixelRatioChanged);
@@ -232,6 +231,8 @@ qreal WaylandPanelInterface::devicePixelRatio() const { return this->layer->devi
232231 void WaylandPanelInterface::set (type value) { this ->layer ->set (value); }
233232
234233proxyPair (bool , isVisible, setVisible);
234+ proxyPair (qint32, implicitWidth, setImplicitWidth);
235+ proxyPair (qint32, implicitHeight, setImplicitHeight);
235236proxyPair (qint32, width, setWidth);
236237proxyPair (qint32, height, setHeight);
237238proxyPair (QuickshellScreenInfo*, screen, setScreen);
0 commit comments