From 172b943f2682b45b76deba6659d7ed89be7ef707 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Wed, 5 Feb 2020 19:55:06 -0300 Subject: [PATCH] made other bits work --- xrandroll/main.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/xrandroll/main.py b/xrandroll/main.py index 0184925..fa1c741 100644 --- a/xrandroll/main.py +++ b/xrandroll/main.py @@ -157,18 +157,17 @@ class Window(QObject): return # Find the primary monitor - primary = [k for k in self.xrandr_info if self.xrandr_info[k]["primary"]] + primary = self.screen.get_primary() if not primary: print("Oops, no primary!") return - primary = self.xrandr_info[primary[0]] - monitor = self.xrandr_info[mon] + monitor = self.screen.monitors[mon] - prim_density_x = primary["res_x"] / primary["w_in_mm"] - prim_density_y = primary["res_y"] / primary["h_in_mm"] + prim_density_x = primary.res_x / primary.w_in_mm + prim_density_y = primary.res_y / primary.h_in_mm - dens_x = monitor["res_x"] / monitor["w_in_mm"] - dens_y = monitor["res_y"] / monitor["h_in_mm"] + dens_x = monitor.res_x / monitor.w_in_mm + dens_y = monitor.res_y / monitor.h_in_mm try: self.ui.horizontalScale.valueChanged.disconnect(