1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-24 01:54:22 +00:00

Default desktop scaling for win32.

This commit is contained in:
jules 2013-08-06 15:25:59 +01:00
parent bd3a75e726
commit cbe2777656
7 changed files with 25 additions and 2 deletions

View file

@ -26,7 +26,7 @@ Desktop::Desktop()
: mouseClickCounter (0), mouseWheelCounter (0),
kioskModeComponent (nullptr),
allowedOrientations (allOrientations),
masterScaleFactor (1.0f)
masterScaleFactor ((float) getDefaultMasterScale())
{
displays = new Displays (*this);
addMouseInputSource();

View file

@ -448,6 +448,8 @@ private:
void triggerFocusCallback();
void handleAsyncUpdate() override;
static double getDefaultMasterScale();
Desktop();
~Desktop();

View file

@ -572,6 +572,11 @@ bool Desktop::canUseSemiTransparentWindows() noexcept
return true;
}
double Desktop::getDefaultMasterScale()
{
return 1.0;
}
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
{
// TODO

View file

@ -297,6 +297,11 @@ void MouseInputSource::setRawMousePosition (Point<int>)
{
}
double Desktop::getDefaultMasterScale()
{
return 1.0;
}
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
{
return Orientations::convertToJuce ([[UIApplication sharedApplication] statusBarOrientation]);

View file

@ -3124,6 +3124,11 @@ void MouseInputSource::setRawMousePosition (Point<int> newPosition)
XWarpPointer (display, None, root, 0, 0, 0, 0, newPosition.getX(), newPosition.getY());
}
double Desktop::getDefaultMasterScale()
{
return 1.0;
}
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
{
return upright;

View file

@ -226,6 +226,11 @@ void MouseInputSource::setRawMousePosition (Point<int> newPosition)
CGAssociateMouseAndMouseCursorPosition (true);
}
double Desktop::getDefaultMasterScale()
{
return 1.0;
}
Desktop::DisplayOrientation Desktop::getCurrentOrientation() const
{
return upright;

View file

@ -141,6 +141,7 @@ static inline Rectangle<int> rectangleFromRECT (const RECT& r) noexcept
return Rectangle<int>::leftTopRightBottom ((int) r.left, (int) r.top, (int) r.right, (int) r.bottom);
}
//==============================================================================
static void setDPIAwareness()
{
if (JUCEApplication::isStandaloneApp())
@ -162,7 +163,7 @@ inline double getDPI()
return dpi;
}
inline double getDisplayScale()
double Desktop::getDefaultMasterScale()
{
return getDPI() / 96.0;
}