Skip to content

Commit

Permalink
Merge pull request #883 from robert-scheck/python-qt5
Browse files Browse the repository at this point in the history
Handle absence of attribute 'screenAt' at 'QApplication'
  • Loading branch information
HenriWahl committed Dec 3, 2022
2 parents 2cb4189 + d4587cc commit 41cdf81
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Nagstamon/QUI/__init__.py
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 41cdf81

Please sign in to comment.