Browse Source

New method Process::makeForegroundProcess() (only implemented in OSX)

tags/2021-05-28
jules 13 years ago
parent
commit
67ee4a6201
6 changed files with 26 additions and 7 deletions
  1. +7
    -0
      modules/juce_core/native/juce_mac_Threads.mm
  2. +5
    -0
      modules/juce_core/threads/juce_Process.h
  3. +1
    -7
      modules/juce_gui_basics/mouse/juce_SelectedItemSet.h
  4. +4
    -0
      modules/juce_gui_basics/native/juce_android_Windowing.cpp
  5. +4
    -0
      modules/juce_gui_basics/native/juce_linux_Windowing.cpp
  6. +5
    -0
      modules/juce_gui_basics/native/juce_win32_Windowing.cpp

+ 7
- 0
modules/juce_core/native/juce_mac_Threads.mm View File

@@ -38,6 +38,13 @@ bool Process::isForegroundProcess()
#endif
}
void Process::makeForegroundProcess()
{
#if JUCE_MAC
[NSApp activateIgnoringOtherApps: YES];
#endif
}
void Process::raisePrivilege()
{
jassertfalse;


+ 5
- 0
modules/juce_core/threads/juce_Process.h View File

@@ -72,6 +72,11 @@ public:
*/
static bool isForegroundProcess();
/** Attempts to make the current process the active one.
(This is not possible on some platforms).
*/
static void makeForegroundProcess();
//==============================================================================
/** Raises the current process's privilege level.


+ 1
- 7
modules/juce_gui_basics/mouse/juce_SelectedItemSet.h View File

@@ -112,9 +112,7 @@ public:
}
/** Selects an item.
If the item is already selected, no change notification will be sent out.
@see selectOnly, addToSelectionBasedOnModifiers
*/
void addToSelection (ParameterType item)
@@ -248,7 +246,6 @@ public:
//==============================================================================
/** Returns the number of currently selected items.
@see getSelectedItem
*/
int getNumSelected() const noexcept
@@ -257,9 +254,7 @@ public:
}
/** Returns one of the currently selected items.
Returns 0 if the index is out-of-range.
@see getNumSelected
*/
SelectableItemType getSelectedItem (const int index) const noexcept
@@ -290,8 +285,7 @@ public:
*/
virtual void itemDeselected (SelectableItemType item) { (void) item; }
/** Used internally, but can be called to force a change message to be sent to the ChangeListeners.
*/
/** Used internally, but can be called to force a change message to be sent to the ChangeListeners. */
void changed (const bool synchronous = false)
{
if (synchronous)


+ 4
- 0
modules/juce_gui_basics/native/juce_android_Windowing.cpp View File

@@ -625,6 +625,10 @@ bool Process::isForegroundProcess()
return true; // TODO
}
void Process::makeForegroundProcess()
{
}
//==============================================================================
void JUCE_CALLTYPE NativeMessageBox::showMessageBoxAsync (AlertWindow::AlertIconType iconType,
const String& title, const String& message,


+ 4
- 0
modules/juce_gui_basics/native/juce_linux_Windowing.cpp View File

@@ -2556,6 +2556,10 @@ bool Process::isForegroundProcess()
return LinuxComponentPeer::isActiveApplication;
}
void Process::makeForegroundProcess()
{
}
//==============================================================================
void ModifierKeys::updateCurrentModifiers() noexcept
{


+ 5
- 0
modules/juce_gui_basics/native/juce_win32_Windowing.cpp View File

@@ -2800,6 +2800,11 @@ bool Process::isForegroundProcess()
return false;
}
void Process::makeForegroundProcess()
{
// is this possible in Windows?
}
//==============================================================================
class WindowsMessageBox : public AsyncUpdater
{


Loading…
Cancel
Save