Skip to content

Commit 2175537

Browse files
authoredApr 24, 2023
Merge pull request #52472 from YoannQDQ/fix-walking-attribute-dialog
2 parents 8ac952b + 6e52378 commit 2175537

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed
 

‎src/gui/qgsattributedialog.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ void QgsAttributeDialog::accept()
8787
void QgsAttributeDialog::show()
8888
{
8989
QDialog::show();
90+
91+
// We cannot call restoreGeometry() in the constructor or init because the dialog is not yet visible
92+
// and the geometry restoration will not take the window decorations (frame) into account.
93+
if ( mFirstShow )
94+
{
95+
mFirstShow = false;
96+
restoreGeometry();
97+
}
9098
raise();
9199
activateWindow();
92100
}
@@ -133,8 +141,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
133141
mMenuBar->addMenu( mMenu );
134142
layout()->setMenuBar( mMenuBar );
135143
}
136-
137-
restoreGeometry();
138144
focusNextChild();
139145
}
140146

‎src/gui/qgsattributedialog.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog, public QgsMapLayerActionCo
136136

137137
static int sFormCounter;
138138

139+
bool mFirstShow = true;
139140
void saveGeometry();
140141
void restoreGeometry();
141142
};

0 commit comments

Comments
 (0)
Please sign in to comment.