Commit eedc4eb8 authored by Robert Knight's avatar Robert Knight
Browse files

If the main window size has not been manually set by the time it is shown

(which will be the case on non-first runs) then manually resize it to
its sizeHint() to work around Qt's restriction on the relative size of
top level windows compared to the desktop size.

CCBUG: 160422

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=793970
parent f9139b74
......@@ -131,7 +131,22 @@ int Application::newInstance()
if ( args->isSet("background-mode") )
startBackgroundMode(window);
else
window->show();
{
// Qt constrains top-level windows which have not been manually resized
// (via QWidget::resize()) to a maximum of 2/3rds of the screen size.
//
// This means that the terminal display might not get the width/height
// it asks for. To work around this, the widget must be manually resized
// to its sizeHint().
//
// This problem only affects the first time the application is run. After
// that KMainWindow will have manually resized the window to its saved size
// at this point (so the Qt::WA_Resized attribute will be set)
if (!window->testAttribute(Qt::WA_Resized))
window->resize(window->sizeHint());
window->show();
}
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment