summaryrefslogtreecommitdiff
path: root/dggui/nativewindow_x11.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dggui/nativewindow_x11.cc')
-rw-r--r--dggui/nativewindow_x11.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/dggui/nativewindow_x11.cc b/dggui/nativewindow_x11.cc
index 04f1b35..2f94935 100644
--- a/dggui/nativewindow_x11.cc
+++ b/dggui/nativewindow_x11.cc
@@ -240,6 +240,15 @@ std::pair<std::size_t, std::size_t> NativeWindowX11::getSize() const
return {width, height};
}
+bool NativeWindowX11::isHiDPI()
+{
+ auto xres = ((((double) DisplayWidth(display, screen)) * 25.4) /
+ ((double) DisplayWidthMM(display, screen))) + 0.5;
+ auto yres = ((((double) DisplayHeight(display, screen)) * 25.4) /
+ ((double) DisplayHeightMM(display, screen))) + 0.5;
+ return xres >= 2 * 96 || yres >= 2 * 96;
+}
+
void NativeWindowX11::move(int x, int y)
{
if(display == nullptr)