From 571c10c49f3b3046bb40245d2d44861706819f16 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 Feb 2015 17:15:17 +0100 Subject: Resize window on resolution change --- src/dialog.cpp | 2 ++ src/globals.cpp | 2 ++ src/globals.h | 2 ++ src/main.cpp | 1 + 4 files changed, 7 insertions(+) (limited to 'src') diff --git a/src/dialog.cpp b/src/dialog.cpp index 6104e22..c54dbb5 100644 --- a/src/dialog.cpp +++ b/src/dialog.cpp @@ -277,6 +277,8 @@ void Dialog::onCenterTimer() { QRect desktopRect = QApplication::desktop()->availableGeometry(this); QPoint center = desktopRect.center(); if (center != oldCenter_) { + if (_fullscreen) + this->resize(desktopRect.width(), desktopRect.height()); this->move(center.x() - this->width() / 2, center.y() - this->height() / 2); oldCenter_ = center; } diff --git a/src/globals.cpp b/src/globals.cpp index c6d3d6d..3fed150 100644 --- a/src/globals.cpp +++ b/src/globals.cpp @@ -32,6 +32,8 @@ const QString news_backup_filename("/tmp/vmchooser2/vmchooser2_news.xml"); QString urlBase; +bool _fullscreen = false; + bool myLessThan(Session* a, Session* b) { return *a < *b; } diff --git a/src/globals.h b/src/globals.h index c0d09d3..b943238 100644 --- a/src/globals.h +++ b/src/globals.h @@ -52,6 +52,8 @@ extern const QString news_backup_filename; extern QString urlBase; +extern bool _fullscreen; + bool myLessThan(Session* a, Session* b); #endif diff --git a/src/main.cpp b/src/main.cpp index bc8d508..b3dbce1 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -231,6 +231,7 @@ int main(int argc, char *argv[]) { if (size == "fullscreen") { width = desktopRect.width(); height = desktopRect.height(); + _fullscreen = true; } w.resize(width, height); -- cgit v1.2.3-55-g7522