From fd12ebfee2fc556e83cbca9a3f7206c01b67d3da Mon Sep 17 00:00:00 2001 From: RduMarais Date: Fri, 16 Jun 2023 22:12:17 +0200 Subject: [PATCH 1/2] added specific case for MacOS Darwin --- remarkable_mouse/common.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/remarkable_mouse/common.py b/remarkable_mouse/common.py index a320651..42bb3ac 100644 --- a/remarkable_mouse/common.py +++ b/remarkable_mouse/common.py @@ -2,7 +2,7 @@ import logging import sys -from screeninfo import get_monitors, Monitor +from screeninfo import get_monitors, Monitor, Enumerator from .codes import codes, types @@ -28,7 +28,12 @@ def get_monitor(region, monitor_num, orientation): # compute size of box encompassing all screens max_x, max_y = 0, 0 - for m in get_monitors(): + if(sys.platform == 'darwin') + log.debug(f"Handling MacOS monitors") + monitors = get_monitors(Enumerator.OSX) + else: + monitors = get_monitors() + for m in monitors: x = m.x + m.width y = m.y + m.height max_x = max(x, max_x) @@ -41,7 +46,7 @@ def get_monitor(region, monitor_num, orientation): name="Fake monitor from region selection" ) else: - monitor = get_monitors()[monitor_num] + monitor = monitors[monitor_num] log.debug(f"Chose monitor: {monitor}") log.debug(f"Screen size: ({max_x}, {max_y})") From 21209b1623dac2c4e61f896f3499bebea3496ecc Mon Sep 17 00:00:00 2001 From: RduMarais Date: Fri, 16 Jun 2023 22:21:50 +0200 Subject: [PATCH 2/2] fixed typo --- remarkable_mouse/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remarkable_mouse/common.py b/remarkable_mouse/common.py index 42bb3ac..c9065f1 100644 --- a/remarkable_mouse/common.py +++ b/remarkable_mouse/common.py @@ -28,7 +28,7 @@ def get_monitor(region, monitor_num, orientation): # compute size of box encompassing all screens max_x, max_y = 0, 0 - if(sys.platform == 'darwin') + if(sys.platform == 'darwin'): log.debug(f"Handling MacOS monitors") monitors = get_monitors(Enumerator.OSX) else: