Don't save last position if the window was hidden already
Bug was happening when calling close() an closed dock widget, it would then save the position of the invisible window. Next time it was open it would appear in a bogus location. 0,0 in my case.
This commit is contained in:
@@ -455,7 +455,8 @@ TabWidget *DockWidgetBase::Private::parentTabWidget() const
|
||||
|
||||
void DockWidgetBase::Private::close()
|
||||
{
|
||||
if (!m_isForceClosing && q->isFloating()) { // only user-closing is interesting to save the geometry
|
||||
if (!m_isForceClosing && q->isFloating() && q->isVisible()) { // only user-closing is interesting to save the geometry
|
||||
// We check for isVisible so we don't save geometry if you call close() on an already closed dock widget
|
||||
m_lastPosition.setLastFloatingGeometry(q->window()->geometry());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user