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 <QtGui/QWindow>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <private/qhighdpiscaling_p.h>
|
||||
|
||||
namespace Ui {
|
||||
namespace Platform {
|
||||
|
|
@ -504,11 +505,12 @@ bool WindowExtentsSupported() {
|
|||
}
|
||||
|
||||
void SetWindowExtents(QWindow *window, const QMargins &extents) {
|
||||
const auto nativeExtents = QHighDpi::toNativePixels(extents, window);
|
||||
if (const auto integration = WaylandIntegration::Instance()) {
|
||||
integration->setWindowExtents(window, extents);
|
||||
integration->setWindowExtents(window, nativeExtents);
|
||||
} else if (::Platform::IsX11()) {
|
||||
#ifndef DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
SetXCBFrameExtents(window, extents);
|
||||
SetXCBFrameExtents(window, nativeExtents);
|
||||
#endif // !DESKTOP_APP_DISABLE_X11_INTEGRATION
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue