bool addWindow (TopLevelWindow* const w) { windows.add (w); checkFocusAsync(); return isWindowActive (w); }
void checkFocus() { startTimer (jmin (1731, getTimerInterval() * 2)); TopLevelWindow* active = nullptr; if (Process::isForegroundProcess()) { active = currentActive; Component* const c = Component::getCurrentlyFocusedComponent(); TopLevelWindow* tlw = dynamic_cast <TopLevelWindow*> (c); if (tlw == nullptr && c != nullptr) tlw = c->findParentComponentOfClass<TopLevelWindow>(); if (tlw != nullptr) active = tlw; } if (active != currentActive) { currentActive = active; for (int i = windows.size(); --i >= 0;) { TopLevelWindow* const tlw = windows.getUnchecked (i); tlw->setWindowActive (isWindowActive (tlw)); i = jmin (i, windows.size() - 1); } Desktop::getInstance().triggerFocusCallback(); } }
bool addWindow (TopLevelWindow* const w) { windows.add (w); startTimer (10); return isWindowActive (w); }
void checkFocus() { startTimer (jmin (1731, getTimerInterval() * 2)); TopLevelWindow* newActive = findCurrentlyActiveWindow(); if (newActive != currentActive) { currentActive = newActive; for (int i = windows.size(); --i >= 0;) if (TopLevelWindow* tlw = windows[i]) tlw->setWindowActive (isWindowActive (tlw)); Desktop::getInstance().triggerFocusCallback(); } }
bool CIrrDeviceNaCl::isWindowMinimized() const { return !isWindowActive(); }
bool CIrrDeviceNaCl::isWindowFocused() const { return isWindowActive(); }