@@ -25,10 +25,18 @@
#include "KsPlotTools.hpp"
/** Macro providing the height of the screen in pixels. */
-#define SCREEN_HEIGHT QGuiApplication::screens()[0]->geometry().height()
+#define SCREEN_HEIGHT \
+ ( \
+ QGuiApplication::screens()[0]->geometry().height() / \
+ QApplication::desktop()->devicePixelRatio() \
+ )
/** Macro providing the width of the screen in pixels. */
-#define SCREEN_WIDTH QGuiApplication::screens()[0]->geometry().width()
+#define SCREEN_WIDTH \
+ ( \
+ QGuiApplication::screens()[0]->geometry().width() / \
+ QApplication::desktop()->devicePixelRatio() \
+ )
//! @cond Doxygen_Suppress
A scale factor (also called "Device Pixel Ratio") is often applied in the display settings when running on laptops having high-resolution screens. Take this scale factor into consideration when calculating the screen size. Note that the size of some widget is set to be a fractions of the total size of the screen. Signed-off-by: Yordan Karadzhov (VMware) <y.karadz@gmail.com> --- kernel-shark/src/KsUtils.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)