Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.5KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 6 technical preview.
  4. Copyright (c) 2017 - ROLI Ltd.
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For this technical preview, this file is not subject to commercial licensing.
  8. JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
  9. EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
  10. DISCLAIMED.
  11. ==============================================================================
  12. */
  13. namespace juce
  14. {
  15. #if (JUCE_WINDOWS && JUCE_WIN_PER_MONITOR_DPI_AWARE) || DOXYGEN
  16. //==============================================================================
  17. /**
  18. A Windows-specific class that temporarily sets the DPI awareness context of
  19. the current thread to be DPI unaware and resets it to the previous context
  20. when it goes out of scope.
  21. If you create one of these before creating a top-level window, the window
  22. will be DPI unaware and bitmap stretched by the OS on a display with >100%
  23. scaling.
  24. You shouldn't use this unless you really know what you are doing and
  25. are dealing with native HWNDs.
  26. @tags{GUI}
  27. */
  28. class JUCE_API ScopedDPIAwarenessDisabler
  29. {
  30. public:
  31. ScopedDPIAwarenessDisabler();
  32. ~ScopedDPIAwarenessDisabler();
  33. private:
  34. void* previousContext = nullptr;
  35. };
  36. #endif
  37. } // namespace juce