From f13543c2721d1199ef9e9f96b65fde14886b9726 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Wed, 22 Feb 2023 08:09:16 +0400 Subject: [PATCH 1/3] fix build/clear notifications on exit on OpenBSD CMake builds ManagerLinux.cpp on `!MAC && !WIN`, that is BSD and Linux. Fix the Linux-only assumption in the shared header. Qt's `Q_OS_UNIX` is defined on Linux, BSDs and macOS alike. --- src/ChatPage.cpp | 2 +- src/notifications/Manager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp index 07406cc8..37449980 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp @@ -1661,7 +1661,7 @@ ChatPage::isRoomActive(const QString &room_id) void ChatPage::removeAllNotifications() { -#if defined(Q_OS_LINUX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) notificationsManager->closeAllNotifications(); #endif } diff --git a/src/notifications/Manager.h b/src/notifications/Manager.h index ee37b3aa..129b5131 100644 --- a/src/notifications/Manager.h +++ b/src/notifications/Manager.h @@ -53,7 +53,7 @@ public slots: #if defined(NHEKO_DBUS_SYS) public: void closeNotifications(QString roomId); -#if defined(Q_OS_LINUX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS) void closeAllNotifications(); #endif From 63c17d78cb2ca05eec22aa1871529be036191694 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Wed, 22 Feb 2023 08:10:54 +0400 Subject: [PATCH 2/3] Recognise OpenBSD on login page --- src/LoginPage.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/LoginPage.h b/src/LoginPage.h index 3a1f6fd0..f20ba0c6 100644 --- a/src/LoginPage.h +++ b/src/LoginPage.h @@ -97,6 +97,8 @@ public: return "Nheko on Windows"; #elif defined(Q_OS_FREEBSD) return "Nheko on FreeBSD"; +#elif defined(Q_OS_OPENBSD) + return "Nheko on OpenBSD"; #else return "Nheko"; #endif From dc1fb1b4543d07ae259691256f670d9795f402f0 Mon Sep 17 00:00:00 2001 From: Klemens Nanni Date: Wed, 22 Feb 2023 08:12:19 +0400 Subject: [PATCH 3/3] Honour Qt scaling factor on OpenBSD Instead of completing the list of Linux, Windows and the BSDs (NetBSD and DragonFly would still be missing), simply flip it to not-macOS to simplify and fix the two other aforementioned BSDs at once. --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index c4ee83f3..44d0dd64 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -159,7 +159,7 @@ main(int argc, char *argv[]) // this needs to be after setting the application name. Or how would we find our settings // file then? -#if defined(Q_OS_LINUX) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD) +#if !defined(Q_OS_MACOS) if (qgetenv("QT_SCALE_FACTOR").size() == 0) { float factor = utils::scaleFactor();