Attempt to fix initial window position on Windows.

This commit is contained in:
John Preston 2024-01-12 13:57:47 +04:00
parent 3eefaac885
commit fc2f41096f
6 changed files with 11 additions and 5 deletions

View File

@ -360,7 +360,7 @@ void Application::run() {
startDomain();
startTray();
_lastActivePrimaryWindow->widget()->show();
_lastActivePrimaryWindow->firstShow();
startMediaView();

View File

@ -475,7 +475,6 @@ void MainWindow::init() {
}
refreshTitleWidget();
initGeometry();
updateTitle();
updateWindowIcon();
}
@ -772,9 +771,10 @@ QRect MainWindow::countInitialGeometry(
return position.rect();
}
void MainWindow::initGeometry() {
void MainWindow::firstShow() {
updateMinimumSize();
if (initGeometryFromSystem()) {
show();
return;
}
const auto geometry = countInitialGeometry(initialPosition());
@ -784,6 +784,7 @@ void MainWindow::initGeometry() {
).arg(geometry.width()
).arg(geometry.height()));
setGeometry(geometry);
show();
}
void MainWindow::positionUpdated() {

View File

@ -132,6 +132,7 @@ public:
void recountGeometryConstraints();
virtual void updateControlsGeometry();
void firstShow();
bool minimizeToTray();
void updateGlobalMenu() {
updateGlobalMenuHook();
@ -197,7 +198,6 @@ private:
[[nodiscard]] Core::WindowPosition nextInitialChildPosition(
bool primary);
[[nodiscard]] QRect countInitialGeometry(Core::WindowPosition position);
void initGeometry();
bool computeIsActive() const;

View File

@ -311,6 +311,10 @@ void Controller::showTermsDelete() {
}));
}
void Controller::firstShow() {
_widget.firstShow();
}
void Controller::finishFirstShow() {
_widget.finishFirstShow();
checkThemeEditor();

View File

@ -74,6 +74,7 @@ public:
[[nodiscard]] Adaptive &adaptive() const;
void firstShow();
void finishFirstShow();
void setupPasscodeLock();

@ -1 +1 @@
Subproject commit 00f5bdaccdff4f53e8ba347f09f2de161b7ca7da
Subproject commit aa39793a91f1186879c15c214a2671d78eab5085