mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 23:15:59 +00:00
Fix bad window rendering with maximize-on-launch.
I have no idea why MainWindow is ruined completely in case you call MainWindow::show, MainWindow::setWindowState(maximized) and then in the same context (without crl::on_main) create full screen viewer.
This commit is contained in:
@@ -235,13 +235,16 @@ void Application::run() {
|
||||
_window->setupIntro();
|
||||
}
|
||||
}
|
||||
DEBUG_LOG(("Application Info: showing."));
|
||||
_window->firstShow();
|
||||
|
||||
_window->widget()->show();
|
||||
|
||||
const auto currentGeometry = _window->widget()->geometry();
|
||||
_mediaView = std::make_unique<Media::View::OverlayWidget>();
|
||||
_window->widget()->setGeometry(currentGeometry);
|
||||
|
||||
DEBUG_LOG(("Application Info: showing."));
|
||||
_window->finishFirstShow();
|
||||
|
||||
if (!locked() && cStartToSettings()) {
|
||||
_window->showSettings();
|
||||
}
|
||||
@@ -274,6 +277,8 @@ void Application::showPhoto(not_null<const PhotoOpenClickHandler*> link) {
|
||||
}
|
||||
|
||||
void Application::showPhoto(not_null<PhotoData*> photo, HistoryItem *item) {
|
||||
Expects(_mediaView != nullptr);
|
||||
|
||||
_mediaView->showPhoto(photo, item);
|
||||
_mediaView->activateWindow();
|
||||
_mediaView->setFocus();
|
||||
@@ -282,12 +287,16 @@ void Application::showPhoto(not_null<PhotoData*> photo, HistoryItem *item) {
|
||||
void Application::showPhoto(
|
||||
not_null<PhotoData*> photo,
|
||||
not_null<PeerData*> peer) {
|
||||
Expects(_mediaView != nullptr);
|
||||
|
||||
_mediaView->showPhoto(photo, peer);
|
||||
_mediaView->activateWindow();
|
||||
_mediaView->setFocus();
|
||||
}
|
||||
|
||||
void Application::showDocument(not_null<DocumentData*> document, HistoryItem *item) {
|
||||
Expects(_mediaView != nullptr);
|
||||
|
||||
if (cUseExternalVideoPlayer()
|
||||
&& document->isVideoFile()
|
||||
&& document->loaded()) {
|
||||
@@ -302,6 +311,8 @@ void Application::showDocument(not_null<DocumentData*> document, HistoryItem *it
|
||||
void Application::showTheme(
|
||||
not_null<DocumentData*> document,
|
||||
const Data::CloudTheme &cloud) {
|
||||
Expects(_mediaView != nullptr);
|
||||
|
||||
_mediaView->showTheme(document, cloud);
|
||||
_mediaView->activateWindow();
|
||||
_mediaView->setFocus();
|
||||
|
Reference in New Issue
Block a user