1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-25 02:04:23 +00:00

Fixed an issue where resizing a VST2 plug-in on a HiDPI monitor on linux would recursively decrease the editor size

This commit is contained in:
hogliux 2016-12-19 10:11:19 +00:00
parent 53ae78f1bb
commit f85bbb2a61

View file

@ -1344,7 +1344,11 @@ public:
#if ! JUCE_LINUX // setSize() on linux causes renoise and energyxt to fail.
setSize (cw, ch);
#else
XResizeWindow (display, (Window) getWindowHandle(), (unsigned int) cw, (unsigned int) ch);
const double scale = Desktop::getInstance().getDisplays().getDisplayContaining (getScreenBounds().getCentre()).scale;
Rectangle<int> childBounds (child->getWidth(), child->getHeight());
childBounds *= scale;
XResizeWindow (display, (Window) getWindowHandle(), childBounds.getWidth(), childBounds.getHeight());
#endif
#if JUCE_MAC