Fix -startintray on Ubuntu.

This commit is contained in:
John Preston 2020-01-28 11:40:27 +03:00
parent e7fbcce9d9
commit 24da40ef05
1 changed files with 11 additions and 12 deletions

View File

@ -583,25 +583,24 @@ void MainWindow::psFirstShow() {
}
#endif
bool showShadows = true;
show();
//_private.enableShadow(winId());
if (cWindowPos().maximized) {
DEBUG_LOG(("Window Pos: First show, setting maximized."));
setWindowState(Qt::WindowMaximized);
}
if ((cLaunchMode() == LaunchModeAutoStart && cStartMinimized()) || cStartInTray()) {
setWindowState(Qt::WindowMinimized);
if (Global::WorkMode().value() == dbiwmTrayOnly || Global::WorkMode().value() == dbiwmWindowAndTray) {
hide();
} else {
show();
}
showShadows = false;
} else {
show();
// If I call hide() synchronously here after show() then on Ubuntu 14.04
// it will show a window frame with transparent window body, without content.
// And to be able to "Show from tray" one more hide() will be required.
crl::on_main(this, [=] {
setWindowState(Qt::WindowMinimized);
if (Global::WorkMode().value() == dbiwmTrayOnly || Global::WorkMode().value() == dbiwmWindowAndTray) {
hide();
} else {
show();
}
});
}
setPositionInited();