Skip to content

Commit

Permalink
Avoid Windows-specific hack to ruin initial main window geometry on L…
Browse files Browse the repository at this point in the history
…inux
  • Loading branch information
ilya-fedin authored and john-preston committed Oct 2, 2023
1 parent 9ad38b9 commit 5c4f006
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Telegram/SourceFiles/core/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,14 +512,16 @@ void Application::startMediaView() {
InvokeQueued(this, [=] {
_mediaView = std::make_unique<Media::View::OverlayWidget>();
});
#else // Q_OS_MAC
#elif defined Q_OS_WIN // Q_OS_MAC || Q_OS_WIN
// On Windows we needed such hack for the main window, otherwise
// somewhere inside the media viewer creating code its geometry
// was broken / lost to some invalid values.
const auto current = _lastActivePrimaryWindow->widget()->geometry();
_mediaView = std::make_unique<Media::View::OverlayWidget>();
_lastActivePrimaryWindow->widget()->Ui::RpWidget::setGeometry(current);
#endif // Q_OS_MAC
#else
_mediaView = std::make_unique<Media::View::OverlayWidget>();
#endif // Q_OS_MAC || Q_OS_WIN
}

void Application::startTray() {
Expand Down

0 comments on commit 5c4f006

Please sign in to comment.