Skip to content

Commit

Permalink
fix #44050 Attribute Dialog moving on screen
Browse files Browse the repository at this point in the history
  • Loading branch information
YoannQDQ committed Apr 24, 2023
1 parent 8282b66 commit 6e52378
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/gui/qgsattributedialog.cpp
Expand Up @@ -87,6 +87,14 @@ void QgsAttributeDialog::accept()
void QgsAttributeDialog::show()
{
QDialog::show();

// We cannot call restoreGeometry() in the constructor or init because the dialog is not yet visible
// and the geometry restoration will not take the window decorations (frame) into account.
if ( mFirstShow )
{
mFirstShow = false;
restoreGeometry();
}
raise();
activateWindow();
}
Expand Down Expand Up @@ -133,8 +141,6 @@ void QgsAttributeDialog::init( QgsVectorLayer *layer, QgsFeature *feature, const
mMenuBar->addMenu( mMenu );
layout()->setMenuBar( mMenuBar );
}

restoreGeometry();
focusNextChild();
}

Expand Down
1 change: 1 addition & 0 deletions src/gui/qgsattributedialog.h
Expand Up @@ -136,6 +136,7 @@ class GUI_EXPORT QgsAttributeDialog : public QDialog, public QgsMapLayerActionCo

static int sFormCounter;

bool mFirstShow = true;
void saveGeometry();
void restoreGeometry();
};
Expand Down

0 comments on commit 6e52378

Please sign in to comment.