Commit 6415d22e authored by Anton Karmanov's avatar Anton Karmanov Committed by Nicolas Fella
Browse files

Fix maximization behaviour

This commit fixes next issues:
- Yakuake main window geometry stays maximized (BUG: 414049).
- In some states maximized geometry may come to settings file and become
  persistent.
- Geometry becomes broken after size normalization.

BUG: 414049
parent d9a4f521
......@@ -1092,18 +1092,16 @@ void MainWindow::wmActiveWindowChanged()
void MainWindow::changeEvent(QEvent* event)
{
if (event->type() == QEvent::WindowStateChange
&& (windowState() & Qt::WindowMaximized)
&& Settings::width() != 100
&& Settings::height() != 100)
if (event->type() == QEvent::WindowStateChange)
{
Settings::setWidth(100);
Settings::setHeight(100);
applyWindowGeometry();
updateWindowWidthMenu();
updateWindowHeightMenu();
if ((windowState() & Qt::WindowMaximized))
{
// Don't alter settings to new size so unmaximizing restores previous geometry.
setWindowGeometry(100, 100, Settings::position());
setWindowState(Qt::WindowMaximized);
} else {
setWindowGeometry(Settings::width(), Settings::height(), Settings::position());
}
}
KMainWindow::changeEvent(event);
......
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