From 6f4d212ca6964b6dd6e83e4f19be35ec1cbda2ba Mon Sep 17 00:00:00 2001 From: ed Date: Wed, 11 Sep 2019 16:19:17 +0100 Subject: [PATCH] Reverted a37b918 which was causing some issues in Cubase 10 --- .../native/juce_win32_Windowing.cpp | 21 ------------------- .../juce_opengl/native/juce_OpenGL_win32.h | 15 +------------ 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 55c862a571..455ceb3990 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -4095,27 +4095,6 @@ JUCE_API bool shouldScaleGLWindow (void* hwnd) } #endif -JUCE_API void setThreadDPIAwareness (void* hwnd) -{ - if (setThreadDPIAwarenessContext != nullptr) - { - if (! JUCEApplicationBase::isStandaloneApp()) - { - if (hwnd != nullptr) - setThreadDPIAwarenessContext (isPerMonitorDPIAwareWindow ((HWND) hwnd) ? DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE - : DPI_AWARENESS_CONTEXT_UNAWARE); - } - else - { - #if JUCE_WIN_PER_MONITOR_DPI_AWARE - setThreadDPIAwarenessContext (DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE); - #else - setThreadDPIAwarenessContext (DPI_AWARENESS_CONTEXT_UNAWARE); - #endif - } - } -} - JUCE_IMPLEMENT_SINGLETON (HWNDComponentPeer::WindowClassHolder) //============================================================================== diff --git a/modules/juce_opengl/native/juce_OpenGL_win32.h b/modules/juce_opengl/native/juce_OpenGL_win32.h index ce213815c5..95c2dd68e3 100644 --- a/modules/juce_opengl/native/juce_OpenGL_win32.h +++ b/modules/juce_opengl/native/juce_OpenGL_win32.h @@ -40,8 +40,6 @@ extern bool shouldScaleGLWindow (void* hwnd); void setProcessDPIAwarenessIfNecessary (void*); #endif - void setThreadDPIAwareness (void*); - //============================================================================== class OpenGLContext::NativeContext #if JUCE_WIN_PER_MONITOR_DPI_AWARE @@ -111,8 +109,6 @@ public: setProcessDPIAwarenessIfNecessary (nativeWindow->getNativeHandle()); #endif - updateThreadDPIAwareness(); - context = &c; return true; } @@ -120,7 +116,7 @@ public: void shutdownOnRenderThread() { deactivateCurrentContext(); context = nullptr; } static void deactivateCurrentContext() { wglMakeCurrent (0, 0); } - bool makeActive() const noexcept { updateThreadDPIAwareness(); return isActive() || wglMakeCurrent (dc, renderContext) != FALSE; } + bool makeActive() const noexcept { return isActive() || wglMakeCurrent (dc, renderContext) != FALSE; } bool isActive() const noexcept { return wglGetCurrentContext() == renderContext; } void swapBuffers() const noexcept { SwapBuffers (dc); } @@ -340,15 +336,6 @@ private: return format; } - void updateThreadDPIAwareness() const - { - if (nativeWindow.get() != nullptr) - setThreadDPIAwareness (nativeWindow->getNativeHandle()); - else - setThreadDPIAwareness (nullptr); - - } - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeContext) };