Convert window extents to native pixels
This commit is contained in:
parent
e09d5714e4
commit
d5d8244abb
1 changed files with 4 additions and 2 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
#include <QtCore/QPoint>
|
#include <QtCore/QPoint>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QtWidgets/QApplication>
|
#include <QtWidgets/QApplication>
|
||||||
|
#include <private/qhighdpiscaling_p.h>
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
@ -504,11 +505,12 @@ bool WindowExtentsSupported() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetWindowExtents(QWindow *window, const QMargins &extents) {
|
void SetWindowExtents(QWindow *window, const QMargins &extents) {
|
||||||
|
const auto nativeExtents = QHighDpi::toNativePixels(extents, window);
|
||||||
if (const auto integration = WaylandIntegration::Instance()) {
|
if (const auto integration = WaylandIntegration::Instance()) {
|
||||||
integration->setWindowExtents(window, extents);
|
integration->setWindowExtents(window, nativeExtents);
|
||||||
} else if (::Platform::IsX11()) {
|
} else if (::Platform::IsX11()) {
|
||||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||||
SetXCBFrameExtents(window, extents);
|
SetXCBFrameExtents(window, nativeExtents);
|
||||||
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue