38 clearSingletonInstance();
43 static void checkCurrentlyFocusedTopLevelWindow()
45 if (
auto* wm = TopLevelWindowManager::getInstanceWithoutCreating())
46 wm->checkFocusAsync();
49 void checkFocusAsync()
58 auto* newActive = findCurrentlyActiveWindow();
60 if (newActive != currentActive)
62 currentActive = newActive;
64 for (
int i = windows.size(); --i >= 0;)
65 if (
auto* tlw = windows[i])
66 tlw->setWindowActive (isWindowActive (tlw));
77 return isWindowActive (w);
84 if (currentActive == w)
85 currentActive =
nullptr;
87 windows.removeFirstMatchingValue (w);
89 if (windows.isEmpty())
98 void timerCallback()
override
105 return (tlw == currentActive
118 if (w ==
nullptr && focusedComp !=
nullptr)
Holds a resizable array of primitive or copy-by-value objects.
static Component *JUCE_CALLTYPE getCurrentlyFocusedComponent() noexcept
Returns the component that currently has the keyboard focus.
bool isShowing() const
Tests whether this component and all its parents are visible.
bool hasKeyboardFocus(bool trueIfChildIsFocused) const
Returns true if this component currently has the keyboard focus.
bool isParentOf(const Component *possibleChild) const noexcept
Checks whether a component is anywhere inside this component or its children.
TargetClass * findParentComponentOfClass() const
Searches the parent components for a component of a specified class.
Classes derived from this will be automatically deleted when the application exits.
static Desktop &JUCE_CALLTYPE getInstance()
There's only one desktop object, and this method will return it.
static bool JUCE_CALLTYPE isForegroundProcess()
Returns true if this application process is the one that the user is currently using.
Makes repeated callbacks to a virtual method at a specified time interval.
int getTimerInterval() const noexcept
Returns the timer's interval.
void startTimer(int intervalInMilliseconds) noexcept
Starts the timer and sets the length of interval required.
A base class for top-level windows.
#define JUCE_IMPLEMENT_SINGLETON(Classname)
This is a counterpart to the JUCE_DECLARE_SINGLETON macros.
#define JUCE_DECLARE_SINGLETON_SINGLETHREADED_MINIMAL(Classname)
Macro to declare member variables and methods for a singleton class.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.