I get the same behaviour on my side when double clicking the QDockWidget titlebar.
I'll go one step further though and say that it's not the previous state that is being "remembered" by the application. I think the application has the correct state stored for the QDockWidget, but it just isn't applying the "float" property correctly. I suspect this because I'm building an app that has a layout manager allowing the user to save an arbitrary number of layouts (or QMainWindow states) and then restore them from a list in the menu. When switching back to a layout that has tabbed QDockWidgets, the floating ones aren't restored (a la this bug), but double clicking their title bars does restore them correctly. So the app knows where they should be placed (i.e. QMainWindow state was actually restored correctly), but maybe just doesn't call QDockWidget::setFloating correctly.
Bookmarks