Commit 7e701cf4 authored by Mariusz Glebocki's avatar Mariusz Glebocki

Reactivate previously active window after flags change

parent b88e677b
...@@ -851,6 +851,9 @@ void MainWindow::setRemoveWindowTitleBarAndFrame(bool frameless) ...@@ -851,6 +851,9 @@ void MainWindow::setRemoveWindowTitleBarAndFrame(bool frameless)
// The window is visible and the setting changed // The window is visible and the setting changed
} else if (windowFlags().testFlag(Qt::FramelessWindowHint) != frameless) { } else if (windowFlags().testFlag(Qt::FramelessWindowHint) != frameless) {
const auto oldGeometry = saveGeometry(); const auto oldGeometry = saveGeometry();
// This happens for every Konsole window. It depends on
// the fact that every window is processed in single thread
const auto oldActiveWindow = KWindowSystem::activeWindow();
setWindowFlags(newFlags); setWindowFlags(newFlags);
...@@ -858,6 +861,7 @@ void MainWindow::setRemoveWindowTitleBarAndFrame(bool frameless) ...@@ -858,6 +861,7 @@ void MainWindow::setRemoveWindowTitleBarAndFrame(bool frameless)
// with previous geometry // with previous geometry
restoreGeometry(oldGeometry); restoreGeometry(oldGeometry);
setVisible(true); setVisible(true);
KWindowSystem::activateWindow(oldActiveWindow);
} }
} }
......
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