Ensure that floating windows are not positioned off-screen when they are shown
At points when a Rect is to be used to position a floating widget, test to see if it overlaps any of the system's screens. If it does not, adjust the Rect to within the closest screen edges.
This commit is contained in:
committed by
Sergio Martins
parent
c0c8399bd7
commit
f1e19ec59c
@@ -513,6 +513,7 @@ FloatingWindow *DockWidgetBase::Private::morphIntoFloatingWindow()
|
||||
auto frame = Config::self().frameworkWidgetFactory()->createFrame();
|
||||
frame->addWidget(q);
|
||||
geo.setSize(geo.size().boundedTo(frame->maxSizeHint()));
|
||||
FloatingWindow::ensureRectIsOnScreen(geo);
|
||||
auto floatingWindow =
|
||||
Config::self().frameworkWidgetFactory()->createFloatingWindow(frame, nullptr, geo);
|
||||
floatingWindow->show();
|
||||
|
||||
Reference in New Issue
Block a user