mirror of
https://invent.kde.org/plasma/layer-shell-qt.git
synced 2025-07-14 19:14:23 -04:00
Call LayerShell::set_size when the window geometry changes
Without this when krunner expands, the frame after kwin will resize it back to the last size the layer shell requested to be resized to. To detect when we should not send an explicit size on window resize events we check the anchors; if we're constrained on opposing edges we want the compositor alone to set the size.
This commit is contained in:
@ -140,4 +140,20 @@ void QWaylandLayerSurface::setLayer(uint32_t layer)
|
||||
set_layer(layer);
|
||||
}
|
||||
|
||||
void QWaylandLayerSurface::setWindowGeometry(const QRect &geometry)
|
||||
{
|
||||
LayerShellQt::Window *interface = Window::get(window()->window());
|
||||
const bool horizontallyConstrained = interface->anchors() & (Window::AnchorLeft & Window::AnchorRight);
|
||||
const bool verticallyConstrained = interface->anchors() & (Window::AnchorTop & Window::AnchorBottom);
|
||||
|
||||
QSize size = geometry.size();
|
||||
if (horizontallyConstrained) {
|
||||
size.setWidth(0);
|
||||
}
|
||||
if (verticallyConstrained) {
|
||||
size.setHeight(0);
|
||||
}
|
||||
set_size(size.width(), size.height());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user