We found what looks like a tracking pipeline issue when working with a floating document window and the main window.
Scenario:
- The main window contains a DocumentDock with multiple tabs.
- One document is moved into a floating window.
- Focus is currently on the floating document window.
- Then the user switches back to a document tab in the main DocumentDock, and this tab is the one that was already active in the main window before switching to the floating window.
- Visually, the tab in the main window becomes highlighted as active, but GlobalDockTrackingChanged does not fire.
- If the user then switches to another tab in the same DocumentDock, the event does fire.
Expected behavior:
- when focus moves from the floating window back to the main window, tracking should be restored;
- either WindowActivated, DockableActivated, or at least GlobalDockTrackingChanged should be raised for the current leaf document in the main DocumentDock.
Actual behavior:
- on float -> main same tab, only DockableDeactivated events are observed;
- there is no new WindowActivated / DockableActivated for the document in the main window;
- GlobalDockTrackingChanged is not restored;
- in addition, in some cases tracking points to container dockables such as DocumentDock / ProportionalDock instead of the leaf document.
Why this looks like a library issue
We added logging for raw factory events:
- WindowActivated
- WindowDeactivated
- DockableActivated
- DockableDeactivated
- GlobalDockTrackingChanged
In the problematic scenario, the library itself does not raise an activated event for the document in the main window.
Example logs when switching from a floating window back to a tab in the main DocumentDock:
[DockEvent] Event=DockableDeactivated; Dockable=DockEditorDocumentViewModel: Title='Новый файл ТИГР.model', Id='df6ef874-cb2f-4a27-b192-08a36fcbbbad'; RootFocused=DockEditorDocumentViewModel: Title='Новый файл ТИГР.model', Id='df6ef874-cb2f-4a27-b192-08a36fcbbbad'; RootActive=DocumentDock: Title='IDocumentDock', Id=''; Window=DockWindow: Title='ModelKI', Id='IDockWindow'
[DockEvent] Event=DockableDeactivated; Dockable=DockEditorDocumentViewModel: Title='GRID.model', Id='c2dcd3e1-0a85-427c-a917-8ca5a312d679'; RootFocused=DockEditorDocumentViewModel: Title='GRID.model', Id='c2dcd3e1-0a85-427c-a917-8ca5a312d679'; RootActive=ProportionalDock: Title='', Id=''; Window=DockWindow: Title='ModelKI', Id='IDockWindow'
This shows:
- deactivation is reported;
- activation of the new current document is not reported;
- RootActive may point to a container instead of a leaf document.
We also see another suspicious behavior in other transitions:
- WindowActivated first points correctly to the leaf document.
- Immediately after that, DockableActivated overwrites tracking with DocumentDock.
Example:
[DockTracking] Reason=WindowActivated; Previous=DockEditorDocumentViewModel: Title='CRCL2.model', Id='e8073cfc-950f-4c18-9384-e8918b7933af'; Current=DockEditorDocumentViewModel: Title='Новый файл ТИГР.model', Id='df6ef874-cb2f-4a27-b192-08a36fcbbbad'
[DockTracking] Reason=DockableActivated; Previous=DockEditorDocumentViewModel: Title='Новый файл ТИГР.model', Id='df6ef874-cb2f-4a27-b192-08a36fcbbbad'; Current=DocumentDock: Title='IDocumentDock', Id=''
This also looks incorrect: after activating a document, tracking degrades to a container dockable.
Questions
- Is this expected behavior, or is it a bug?
- Is GlobalDockTrackingChanged supposed to reliably point to the leaf dockable/document, rather than containers such as DocumentDock and ProportionalDock?
- Should float window -> main window same tab raise WindowActivated / DockableActivated for the current document in the main DocumentDock?
Environment
- Dock.Model.ReactiveUI 11.3.11.21
- corresponding Dock.Avalonia
- Avalonia 11.3.11
- .NET 10
We found what looks like a tracking pipeline issue when working with a floating document window and the main window.
Scenario:
Expected behavior:
Actual behavior:
Why this looks like a library issue
We added logging for raw factory events:
In the problematic scenario, the library itself does not raise an activated event for the document in the main window.
Example logs when switching from a floating window back to a tab in the main DocumentDock:
We also see another suspicious behavior in other transitions:
Example:
This also looks incorrect: after activating a document, tracking degrades to a container dockable.
Questions
Environment