#include "displayglwidget.h"
#include "displayswwidget.h"
#include "resource/ui_strings.h"
+#include "uiutil.h"
extern "C" {
#include "util/ui_operations.h"
/* override */
void MainWindow::resize(const QSize &size)
{
+ if (size.width() <= 0 || size.height() <= 0) {
+ qWarning() << "Invalid scale size. Cannot be less than zero." << size;
+ return;
+ }
+
setFixedSize(QSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX));
QWidget::resize(size);
}
QWidget::resizeEvent(event);
setFixedSize(size());
+
+ /* correctional position */
+ int xx = pos().x();
+ int yy = pos().y();
+ QRect hostBounds = UiUtil::getHostScreenBounds();
+ xx = qMax(xx, hostBounds.x());
+ yy = qMax(yy, hostBounds.y());
+ // shift a little bit from screen edge to inside of bounds
+ xx = qMin(xx, hostBounds.x() + hostBounds.width() - 100);
+ yy = qMin(yy, hostBounds.y() + hostBounds.height() - 100);
+ move(xx, yy);
}
/* override */