linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
To: linux-trace-devel@vger.kernel.org
Cc: rostedt@goodmis.org, "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Subject: [PATCH 2/4] kernel-shark: Have correct screen geometry on high-resolution screens
Date: Wed, 16 Sep 2020 09:50:05 +0300	[thread overview]
Message-ID: <20200916065007.9755-2-y.karadz@gmail.com> (raw)
In-Reply-To: <20200916065007.9755-1-y.karadz@gmail.com>

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(-)

diff --git a/kernel-shark/src/KsUtils.hpp b/kernel-shark/src/KsUtils.hpp
index 2772b84..a07af1a 100644
--- a/kernel-shark/src/KsUtils.hpp
+++ b/kernel-shark/src/KsUtils.hpp
@@ -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
 
-- 
2.26.2


  reply	other threads:[~2020-09-16  6:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-16  6:50 [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1 Yordan Karadzhov (VMware)
2020-09-16  6:50 ` Yordan Karadzhov (VMware) [this message]
2020-09-16  6:50 ` [PATCH 3/4] kernel-shark: Check if Qt has been found when building the examples Yordan Karadzhov (VMware)
2020-09-16  6:50 ` [PATCH 4/4] kernel-shark: Fix dependency (symbol resolving) issue Yordan Karadzhov (VMware)
2020-09-29 21:05 ` [PATCH 1/4] kernel-shark :Fix all build warnings for gcc 10.2.1 Steven Rostedt
2020-09-30 13:55   ` Yordan Karadzhov (VMware)
2020-09-30 14:03     ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200916065007.9755-2-y.karadz@gmail.com \
    --to=y.karadz@gmail.com \
    --cc=linux-trace-devel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).