From 4af1478dfbc2cdfc962d8496a72a5963572bc24b Mon Sep 17 00:00:00 2001 From: jules Date: Fri, 8 Aug 2014 09:23:01 +0100 Subject: [PATCH] Fixed a few windowing issues when using global scale factors. --- modules/juce_gui_basics/native/juce_linux_Windowing.cpp | 8 ++++---- .../native/juce_mac_NSViewComponentPeer.mm | 2 +- modules/juce_gui_basics/native/juce_win32_Windowing.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp index e1ee828a2b..b9bd76bbd9 100644 --- a/modules/juce_gui_basics/native/juce_linux_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_linux_Windowing.cpp @@ -1045,7 +1045,7 @@ public: r = Desktop::getInstance().getDisplays().getMainDisplay().userArea; if (! r.isEmpty()) - setBounds (r, shouldBeFullScreen); + setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, r), shouldBeFullScreen); component.repaint(); } @@ -1115,9 +1115,9 @@ public: if (c == &component) break; - // TODO: needs scaling correctly - if (c->contains (localPos + bounds.getPosition() - c->getScreenPosition())) - return false; + if (ComponentPeer* peer = c->getPeer()) + if (peer->contains (localPos + bounds.getPosition() - peer->getBounds().getPosition(), true)) + return false; } if (trueIfInAChildWindow) diff --git a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm index c969803c90..45569b83b2 100644 --- a/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm +++ b/modules/juce_gui_basics/native/juce_mac_NSViewComponentPeer.mm @@ -369,7 +369,7 @@ public: // (can't call the component's setBounds method because that'll reset our fullscreen flag) if (r != component.getBounds() && ! r.isEmpty()) - setBounds (r, shouldBeFullScreen); + setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, r), shouldBeFullScreen); } } } diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 63b5d4dcda..31e2dd1757 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -763,7 +763,7 @@ public: ShowWindow (hwnd, SW_SHOWNORMAL); if (! boundsCopy.isEmpty()) - setBounds (boundsCopy, false); + setBounds (ScalingHelpers::scaledScreenPosToUnscaled (component, boundsCopy), false); } else {