From d4587cc63ac6dce0c4fe13e92f782631c7217a8a Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Fri, 2 Dec 2022 19:58:30 +0100 Subject: [PATCH] Handle absence of attribute 'screenAt' at 'QApplication' QApplication (using the default Qt5 and its default Qt5 Python binding on RHEL/CentOS 7) has no attribute 'screenAt'. --- Nagstamon/QUI/__init__.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Nagstamon/QUI/__init__.py b/Nagstamon/QUI/__init__.py index e9fb314c..7b5ade54 100644 --- a/Nagstamon/QUI/__init__.py +++ b/Nagstamon/QUI/__init__.py @@ -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