ormsolutions/NORMA

Blank diagrams on reload in VS2019 with current Windows 10

Closed this issue · 0 comments

The Dsl framework is not successfully parenting the DiagramClientView window (where the ORM shapes are drawn) inside the VSDiagramView window (the viewport that owns the scrollbars for the client view) on a reload.

The result is that any reload (either from file save, or simply from adding an extension) successfully loads the file but does not show any diagrams (except in diagram spy, which is fine).

This is caused by a change in Windows 10 1703 and later that changes the behavior of 'Dpi awareness'. After this change the SetParent windows API will fail if you try to associated two windows with different 'awareness' levels. In this case, the DiagramClientView (child window) is created before the parent window and gets a different awareness setting, which then cannot be attached to the parent handle when it is created.

The hack fix is to recreate the handle for the diagram view before we do too much with it. This will have to do until Microsoft provides a real fix, which will involve creating the child window after the parent windows is attached and knows its final Dpi state.