2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Take shadow into account when saving/restoring window geometry

This commit is contained in:
Ilya Fedin
2021-04-11 12:39:22 +04:00
committed by John Preston
parent d984c5924d
commit 7b466e0643

View File

@@ -461,6 +461,7 @@ void MainWindow::recountGeometryConstraints() {
}
void MainWindow::initSize() {
updateShadowSize();
updateMinimumSize();
if (initSizeFromSystem()) {
@@ -562,6 +563,7 @@ void MainWindow::initSize() {
}
maximized = position.maximized;
}
geometry += _padding;
DEBUG_LOG(("Window Pos: Setting first %1, %2, %3, %4").arg(geometry.x()).arg(geometry.y()).arg(geometry.width()).arg(geometry.height()));
setGeometry(geometry);
}
@@ -679,7 +681,7 @@ void MainWindow::savePosition(Qt::WindowState state) {
realPosition.maximized = 1;
DEBUG_LOG(("Window Pos: Saving maximized position."));
} else {
auto r = geometry();
auto r = geometry().marginsRemoved(_padding);
realPosition.x = r.x();
realPosition.y = r.y();
realPosition.w = r.width() - (_rightColumn ? _rightColumn->width() : 0);