diff --git a/Editor/ToolbarCallback.cs b/Editor/ToolbarCallback.cs index 22e90cb..4a665e5 100644 --- a/Editor/ToolbarCallback.cs +++ b/Editor/ToolbarCallback.cs @@ -77,6 +77,9 @@ void RegisterCallback(string root, Action cb) { parent.Add(container); toolbarZone.Add(parent); } + + // Handle root visual element being detached from m_currentToolbar when changing between displays of different DPI + mRoot.RegisterCallback(_ => m_currentToolbar = null); #else #if UNITY_2020_1_OR_NEWER var windowBackend = m_windowBackend.GetValue(m_currentToolbar);