mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ScopedDPIAwarenessDisabler: Move to juce_gui_basics
This commit is contained in:
parent
8b45ff83e2
commit
4e694c96b3
6 changed files with 37 additions and 44 deletions
|
|
@ -371,3 +371,9 @@ namespace juce
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
#if ! JUCE_WINDOWS
|
||||
juce::ScopedDPIAwarenessDisabler::ScopedDPIAwarenessDisabler() { ignoreUnused (previousContext); }
|
||||
juce::ScopedDPIAwarenessDisabler::~ScopedDPIAwarenessDisabler() {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -370,3 +370,4 @@ namespace juce
|
|||
|
||||
#include "layout/juce_GridItem.h"
|
||||
#include "layout/juce_Grid.h"
|
||||
#include "native/juce_ScopedDPIAwarenessDisabler.h"
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@
|
|||
#include <juce_audio_plugin_client/AAX/juce_AAX_Modifier_Injector.h>
|
||||
#endif
|
||||
|
||||
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
|
||||
#include <juce_gui_extra/embedding/juce_ScopedDPIAwarenessDisabler.h>
|
||||
#endif
|
||||
|
||||
namespace juce
|
||||
{
|
||||
|
||||
|
|
@ -572,38 +568,34 @@ ScopedThreadDPIAwarenessSetter::ScopedThreadDPIAwarenessSetter (void* nativeWind
|
|||
pimpl = std::make_unique<NativeImpl> ((HWND) nativeWindow);
|
||||
}
|
||||
|
||||
ScopedThreadDPIAwarenessSetter::~ScopedThreadDPIAwarenessSetter()
|
||||
ScopedThreadDPIAwarenessSetter::~ScopedThreadDPIAwarenessSetter() = default;
|
||||
|
||||
ScopedDPIAwarenessDisabler::ScopedDPIAwarenessDisabler()
|
||||
{
|
||||
if (! isPerMonitorDPIAwareThread())
|
||||
return;
|
||||
|
||||
if (setThreadDPIAwarenessContext != nullptr)
|
||||
{
|
||||
previousContext = setThreadDPIAwarenessContext (DPI_AWARENESS_CONTEXT_UNAWARE);
|
||||
|
||||
#if JUCE_DEBUG
|
||||
++numActiveScopedDpiAwarenessDisablers;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#if JUCE_MODULE_AVAILABLE_juce_gui_extra
|
||||
ScopedDPIAwarenessDisabler::ScopedDPIAwarenessDisabler()
|
||||
{
|
||||
if (! isPerMonitorDPIAwareThread())
|
||||
return;
|
||||
ScopedDPIAwarenessDisabler::~ScopedDPIAwarenessDisabler()
|
||||
{
|
||||
if (previousContext != nullptr)
|
||||
{
|
||||
setThreadDPIAwarenessContext ((DPI_AWARENESS_CONTEXT) previousContext);
|
||||
|
||||
if (setThreadDPIAwarenessContext != nullptr)
|
||||
{
|
||||
previousContext = setThreadDPIAwarenessContext (DPI_AWARENESS_CONTEXT_UNAWARE);
|
||||
|
||||
#if JUCE_DEBUG
|
||||
++numActiveScopedDpiAwarenessDisablers;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
ScopedDPIAwarenessDisabler::~ScopedDPIAwarenessDisabler()
|
||||
{
|
||||
if (previousContext != nullptr)
|
||||
{
|
||||
setThreadDPIAwarenessContext ((DPI_AWARENESS_CONTEXT) previousContext);
|
||||
|
||||
#if JUCE_DEBUG
|
||||
--numActiveScopedDpiAwarenessDisablers;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if JUCE_DEBUG
|
||||
--numActiveScopedDpiAwarenessDisablers;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
using SettingChangeCallbackFunc = void (*)(void);
|
||||
|
|
@ -3358,7 +3350,7 @@ private:
|
|||
|
||||
handleMovedOrResized();
|
||||
|
||||
return ! dontRepaint; // to allow non-accelerated openGL windows to draw themselves correctly..
|
||||
return ! dontRepaint; // to allow non-accelerated openGL windows to draw themselves correctly.
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -189,14 +189,9 @@
|
|||
#endif
|
||||
|
||||
//==============================================================================
|
||||
#if ! JUCE_WINDOWS
|
||||
juce::ScopedDPIAwarenessDisabler::ScopedDPIAwarenessDisabler() { ignoreUnused (previousContext); }
|
||||
juce::ScopedDPIAwarenessDisabler::~ScopedDPIAwarenessDisabler() {}
|
||||
|
||||
#if JUCE_WEB_BROWSER
|
||||
juce::WebBrowserComponent::WebBrowserComponent (ConstructWithoutPimpl) {}
|
||||
juce::WindowsWebView2WebBrowserComponent::WindowsWebView2WebBrowserComponent (bool unloadWhenHidden,
|
||||
const WebView2Preferences&)
|
||||
: juce::WebBrowserComponent (unloadWhenHidden) {}
|
||||
#endif
|
||||
#if ! JUCE_WINDOWS && JUCE_WEB_BROWSER
|
||||
juce::WebBrowserComponent::WebBrowserComponent (ConstructWithoutPimpl) {}
|
||||
juce::WindowsWebView2WebBrowserComponent::WindowsWebView2WebBrowserComponent (bool unloadWhenHidden,
|
||||
const WebView2Preferences&)
|
||||
: WebBrowserComponent (unloadWhenHidden) {}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@
|
|||
#include "embedding/juce_NSViewComponent.h"
|
||||
#include "embedding/juce_UIViewComponent.h"
|
||||
#include "embedding/juce_XEmbedComponent.h"
|
||||
#include "embedding/juce_ScopedDPIAwarenessDisabler.h"
|
||||
#include "embedding/juce_HWNDComponent.h"
|
||||
#include "misc/juce_AppleRemote.h"
|
||||
#include "misc/juce_BubbleMessageComponent.h"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue