Use QPA API to set Wayland margins property

This commit is contained in:
Ilya Fedin 2022-04-11 13:15:29 +04:00 committed by John Preston
parent d5a37c74b1
commit e09d5714e4

View file

@ -105,13 +105,25 @@ bool WaylandIntegration::windowExtentsSupported() {
void WaylandIntegration::setWindowExtents( void WaylandIntegration::setWindowExtents(
QWindow *window, QWindow *window,
const QMargins &extents) { const QMargins &extents) {
window->setProperty( const auto native = QGuiApplication::platformNativeInterface();
if (!native) {
return;
}
native->setWindowProperty(
window->handle(),
"_desktopApp_waylandCustomMargins", "_desktopApp_waylandCustomMargins",
QVariant::fromValue<QMargins>(extents)); QVariant::fromValue<QMargins>(extents));
} }
void WaylandIntegration::unsetWindowExtents(QWindow *window) { void WaylandIntegration::unsetWindowExtents(QWindow *window) {
window->setProperty( const auto native = QGuiApplication::platformNativeInterface();
if (!native) {
return;
}
native->setWindowProperty(
window->handle(),
"_desktopApp_waylandCustomMargins", "_desktopApp_waylandCustomMargins",
QVariant()); QVariant());
} }