Windows: Fix initial FloatingWindow size in HDPI

When:
- Screen A (100%), B (150%)
- MainWindow on screen B
- Trying to open a floating window on screen A (via setGeometry())

The Qt Windows QPA would error out when setting the geometry and it
would be too small.

The solution is to call setGeometry() before we create the QWindow.

Too much of an edge case to risk putting this on 1.3 branch.
Will be in 1.4.0.

Fixes #191
This commit is contained in:
Sergio Martins
2021-06-22 23:00:04 +01:00
parent f74fd52d53
commit 6f031e3c33
7 changed files with 22 additions and 18 deletions

View File

@@ -87,12 +87,12 @@ Layouting::Separator *DefaultWidgetFactory::createSeparator(Layouting::Widget *p
FloatingWindow *DefaultWidgetFactory::createFloatingWindow(MainWindowBase *parent) const
{
return new FloatingWindowWidget(parent);
return new FloatingWindowWidget(QRect(), parent);
}
FloatingWindow *DefaultWidgetFactory::createFloatingWindow(Frame *frame, MainWindowBase *parent) const
FloatingWindow *DefaultWidgetFactory::createFloatingWindow(Frame *frame, MainWindowBase *parent, QRect suggestedGeometry) const
{
return new FloatingWindowWidget(frame, parent);
return new FloatingWindowWidget(frame, suggestedGeometry, parent);
}
DropIndicatorOverlayInterface *DefaultWidgetFactory::createDropIndicatorOverlay(DropArea *dropArea) const