Skip to content

Commit 914b65d

Browse files
committed
KDE: Fix maximized window on startup caused by system session management
1 parent c966cf5 commit 914b65d

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/main.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,14 @@ int main(int argc,
9595
w.setWindowFlags(Qt::WindowContextHelpButtonHint | Qt::WindowCloseButtonHint);
9696
w.hide();
9797

98-
if (!parser.isSet(tray))
98+
if (!parser.isSet(tray))
9999
{
100-
w.show();
100+
/* Session manager: Prevent system from launching this app maximized on session restore (= system startup).
101+
* Affects DEs with enabled session restore feature; is independent from the built-in autostart feature */
102+
if(!qApp->isSessionRestored())
103+
{
104+
w.show();
105+
}
101106
}
102107

103108
QApplication::setQuitOnLastWindowClosed(true);

0 commit comments

Comments
 (0)