Use QPA API to set Wayland margins property
This commit is contained in:
parent
d5a37c74b1
commit
e09d5714e4
1 changed files with 14 additions and 2 deletions
|
|
@ -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());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue