mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-04-18 13:16:28 +00:00
Hide the window instantly within autostart
Unnecessary minimize triggers animation that provides a sign there were a window. There's also seem to be queuing of hide on Linux that makes the effect even more noticable and it seems the bug this workaround was made for no longer reproduces.
This commit is contained in:
parent
b9519dd5b9
commit
f4f7b5b99c
@ -184,22 +184,12 @@ void MainWindow::applyInitialWorkMode() {
|
||||
|| (cLaunchMode() == LaunchModeAutoStart
|
||||
&& cStartMinimized()
|
||||
&& !Core::App().passcodeLocked())) {
|
||||
const auto minimizeAndHide = [=] {
|
||||
DEBUG_LOG(("Window Pos: First show, setting minimized after."));
|
||||
setWindowState(windowState() | Qt::WindowMinimized);
|
||||
if (workMode == Core::Settings::WorkMode::TrayOnly
|
||||
|| workMode == Core::Settings::WorkMode::WindowAndTray) {
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
if (Platform::IsLinux()) {
|
||||
// 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, minimizeAndHide);
|
||||
DEBUG_LOG(("Window Pos: First show, setting minimized after."));
|
||||
if (workMode == Core::Settings::WorkMode::TrayOnly
|
||||
|| workMode == Core::Settings::WorkMode::WindowAndTray) {
|
||||
hide();
|
||||
} else {
|
||||
minimizeAndHide();
|
||||
setWindowState(windowState() | Qt::WindowMinimized);
|
||||
}
|
||||
}
|
||||
setPositionInited();
|
||||
|
Loading…
Reference in New Issue
Block a user