mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
ScopedThreadDPIAwarenessSetter: Make moveable
This commit is contained in:
parent
880b76983e
commit
80bb7b0861
3 changed files with 8 additions and 3 deletions
|
|
@ -48,13 +48,13 @@ public:
|
|||
if (comp->isOnDesktop())
|
||||
{
|
||||
#if JUCE_WINDOWS
|
||||
const auto scope = [&]() -> std::unique_ptr<ScopedThreadDPIAwarenessSetter>
|
||||
const auto scope = [&]() -> std::optional<ScopedThreadDPIAwarenessSetter>
|
||||
{
|
||||
if (comp != nullptr)
|
||||
if (auto* handle = comp->getWindowHandle())
|
||||
return std::make_unique<ScopedThreadDPIAwarenessSetter> (handle);
|
||||
return ScopedThreadDPIAwarenessSetter (handle);
|
||||
|
||||
return nullptr;
|
||||
return {};
|
||||
}();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -40,6 +40,8 @@ class ScopedThreadDPIAwarenessSetter
|
|||
{
|
||||
public:
|
||||
explicit ScopedThreadDPIAwarenessSetter (void* nativeWindow);
|
||||
ScopedThreadDPIAwarenessSetter (ScopedThreadDPIAwarenessSetter&&) noexcept;
|
||||
ScopedThreadDPIAwarenessSetter& operator= (ScopedThreadDPIAwarenessSetter&&) noexcept;
|
||||
~ScopedThreadDPIAwarenessSetter();
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -619,6 +619,9 @@ ScopedThreadDPIAwarenessSetter::ScopedThreadDPIAwarenessSetter (void* nativeWind
|
|||
|
||||
ScopedThreadDPIAwarenessSetter::~ScopedThreadDPIAwarenessSetter() = default;
|
||||
|
||||
ScopedThreadDPIAwarenessSetter::ScopedThreadDPIAwarenessSetter (ScopedThreadDPIAwarenessSetter&&) noexcept = default;
|
||||
ScopedThreadDPIAwarenessSetter& ScopedThreadDPIAwarenessSetter::operator= (ScopedThreadDPIAwarenessSetter&&) noexcept = default;
|
||||
|
||||
static auto& getScopedDPIAwarenessDisablerFunctions()
|
||||
{
|
||||
struct Functions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue