diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp index 734850ab2a..ae02137919 100644 --- a/Telegram/SourceFiles/core/application.cpp +++ b/Telegram/SourceFiles/core/application.cpp @@ -207,10 +207,6 @@ void Application::run() { _window = std::make_unique(&activeAccount()); - const auto currentGeometry = _window->widget()->geometry(); - _mediaView = std::make_unique(); - _window->widget()->setGeometry(currentGeometry); - QCoreApplication::instance()->installEventFilter(this); connect( static_cast(QCoreApplication::instance()), @@ -242,6 +238,8 @@ void Application::run() { DEBUG_LOG(("Application Info: showing.")); _window->firstShow(); + _mediaView = std::make_unique(); + if (!locked() && cStartToSettings()) { _window->showSettings(); } diff --git a/Telegram/SourceFiles/mainwindow.cpp b/Telegram/SourceFiles/mainwindow.cpp index b404807dc0..84113702eb 100644 --- a/Telegram/SourceFiles/mainwindow.cpp +++ b/Telegram/SourceFiles/mainwindow.cpp @@ -194,6 +194,7 @@ void MainWindow::setupPasscodeLock() { if (animated) { _passcodeLock->showAnimated(bg); } else { + _passcodeLock->showFinished(); setInnerFocus(); } } diff --git a/Telegram/SourceFiles/platform/win/main_window_win.cpp b/Telegram/SourceFiles/platform/win/main_window_win.cpp index d69ca9a386..2dffbccfb1 100644 --- a/Telegram/SourceFiles/platform/win/main_window_win.cpp +++ b/Telegram/SourceFiles/platform/win/main_window_win.cpp @@ -833,12 +833,8 @@ void MainWindow::psFirstShow() { if (Global::WorkMode().value() == dbiwmTrayOnly || Global::WorkMode().value() == dbiwmWindowAndTray) { hide(); - } else { - show(); } showShadows = false; - } else { - show(); } setPositionInited(); diff --git a/Telegram/SourceFiles/window/main_window.cpp b/Telegram/SourceFiles/window/main_window.cpp index 7e160d4c09..b608c4d3af 100644 --- a/Telegram/SourceFiles/window/main_window.cpp +++ b/Telegram/SourceFiles/window/main_window.cpp @@ -435,15 +435,6 @@ void MainWindow::initSize() { } DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height())); setGeometry(geometry); - if (geometryScreen != primaryScreen) { - // In case screen DPI changed we show the window now, - // so that when we call setGeometry() once again after - // make_unique it already - // has adjusted by dpi geometry saved in QWidget. - // - // Somehow should fix https://github.com/telegramdesktop/tdesktop/issues/6804 - show(); - } } void MainWindow::positionUpdated() { diff --git a/Telegram/SourceFiles/window/window_lock_widgets.cpp b/Telegram/SourceFiles/window/window_lock_widgets.cpp index 8f3af9398e..6489273b85 100644 --- a/Telegram/SourceFiles/window/window_lock_widgets.cpp +++ b/Telegram/SourceFiles/window/window_lock_widgets.cpp @@ -69,15 +69,17 @@ void LockWidget::showAnimated(const QPixmap &bgAnimCache, bool back) { void LockWidget::animationCallback() { update(); if (!_a_show.animating()) { - showChildren(); - _window->widget()->setInnerFocus(); - - Ui::showChatsList(); - - _cacheUnder = _cacheOver = QPixmap(); + showFinished(); } } +void LockWidget::showFinished() { + showChildren(); + _window->widget()->setInnerFocus(); + Ui::showChatsList(); + _cacheUnder = _cacheOver = QPixmap(); +} + void LockWidget::paintEvent(QPaintEvent *e) { Painter p(this); diff --git a/Telegram/SourceFiles/window/window_lock_widgets.h b/Telegram/SourceFiles/window/window_lock_widgets.h index 9e6d834005..848fbafd89 100644 --- a/Telegram/SourceFiles/window/window_lock_widgets.h +++ b/Telegram/SourceFiles/window/window_lock_widgets.h @@ -32,6 +32,7 @@ public: virtual void setInnerFocus(); void showAnimated(const QPixmap &bgAnimCache, bool back = false); + void showFinished(); protected: void paintEvent(QPaintEvent *e) override;