UserInterface * GetRelevantUIForWindow(AppWindow * window) { if (!window) return NULL; UserInterface * globalUI = window->GetGlobalUI(); if (globalUI && globalUI->HasActivatableElement()) return globalUI; return window->GetUI(); }
/// Fetches either the Global or Active UI, taking into consideration both active AppWindow and if there exist any valid content in the Global UI. UserInterface * RelevantUI() { AppWindow * window = WindowMan.GetCurrentlyActiveWindow(); if (!window) return NULL; UserInterface * globalUI = window->GetGlobalUI(); if (globalUI && globalUI->HasActivatableElement()) return globalUI; return window->GetUI(); }