Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions remarkable_mouse/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand All @@ -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})")
Expand Down