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.

48 lines
1.4KB

  1. /*
  2. ==============================================================================
  3. This file is part of the JUCE 7 technical preview.
  4. Copyright (c) 2022 - Raw Material Software Limited
  5. You may use this code under the terms of the GPL v3
  6. (see www.gnu.org/licenses).
  7. For the technical preview this file cannot be licensed commercially.
  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. //==============================================================================
  16. /**
  17. A Windows-specific class that temporarily sets the DPI awareness context of
  18. the current thread to be DPI unaware and resets it to the previous context
  19. when it goes out of scope.
  20. If you create one of these before creating a top-level window, the window
  21. will be DPI unaware and bitmap stretched by the OS on a display with >100%
  22. scaling.
  23. You shouldn't use this unless you really know what you are doing and
  24. are dealing with native HWNDs.
  25. @tags{GUI}
  26. */
  27. class JUCE_API ScopedDPIAwarenessDisabler
  28. {
  29. public:
  30. ScopedDPIAwarenessDisabler();
  31. ~ScopedDPIAwarenessDisabler();
  32. private:
  33. void* previousContext = nullptr;
  34. };
  35. } // namespace juce