[gnome-panel/wip/muktupavels/hidpi: 4/6] multiscreen: have monitor geometry in application pixels
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-panel/wip/muktupavels/hidpi: 4/6] multiscreen: have monitor geometry in application pixels
- Date: Thu, 22 Apr 2021 18:19:56 +0000 (UTC)
commit d8ac8ff3039d092dccce6e233bbe92f16cbb9285
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Thu Apr 22 20:01:07 2021 +0300
multiscreen: have monitor geometry in application pixels
gnome-panel/panel-multiscreen.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gnome-panel/panel-multiscreen.c b/gnome-panel/panel-multiscreen.c
index 6f9a92d80..d87b8e432 100644
--- a/gnome-panel/panel-multiscreen.c
+++ b/gnome-panel/panel-multiscreen.c
@@ -31,6 +31,7 @@
#include <gdk/gdkx.h>
#include "panel-multiscreen.h"
+#include "panel-util.h"
#include <string.h>
@@ -100,6 +101,7 @@ panel_multiscreen_get_randr_monitors_for_screen (int *monitors_ret,
GArray *geometries;
int i;
gboolean driver_is_pre_randr_1_2;
+ int window_scale;
if (!have_randr)
return FALSE;
@@ -162,6 +164,7 @@ panel_multiscreen_get_randr_monitors_for_screen (int *monitors_ret,
resources->noutput);
driver_is_pre_randr_1_2 = FALSE;
+ window_scale = panel_util_get_window_scaling_factor ();
for (i = 0; i < resources->noutput; i++)
{
@@ -184,10 +187,10 @@ panel_multiscreen_get_randr_monitors_for_screen (int *monitors_ret,
crtc = XRRGetCrtcInfo (xdisplay, resources,
output->crtc);
- rect.x = crtc->x;
- rect.y = crtc->y;
- rect.width = crtc->width;
- rect.height = crtc->height;
+ rect.x = crtc->x / window_scale;
+ rect.y = crtc->y / window_scale;
+ rect.width = crtc->width / window_scale;
+ rect.height = crtc->height / window_scale;
XRRFreeCrtcInfo (crtc);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]