Skip to content

Commit

Permalink
Handle absence of attribute 'screenAt' at 'QApplication'
Browse files Browse the repository at this point in the history
QApplication (using the default Qt5 and its default Qt5 Python binding on
RHEL/CentOS 7) has no attribute 'screenAt'.
  • Loading branch information
robert-scheck committed Dec 2, 2022
1 parent 2cb4189 commit d4587cc
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Nagstamon/QUI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6976,11 +6976,16 @@ def get_screen_name(x, y):
# integerify these values as they *might* be strings
x = int(x)
y = int(y)
screen = APP.screenAt(QPoint(x, y))
del x, y
if screen:
return screen.name
else:

# QApplication (using Qt5 and/or its Python binding on RHEL/CentOS 7) has no attribute 'screenAt'
try:
screen = APP.screenAt(QPoint(x, y))
del x, y
if screen:
return screen.name
else:
return None
except:
return None


Expand Down

0 comments on commit d4587cc

Please sign in to comment.