From 05cb74c094d285a568103a413c0d3e4ca95b8d21 Mon Sep 17 00:00:00 2001
From: Pascal Abresch <nep@packageloss.eu>
Date: Sat, 24 Apr 2021 07:46:12 +0200
Subject: HACK: disable rounding effect for avatars Having this enabled
 produces empty avatars for some reason


diff --git a/resources/qml/Avatar.qml b/resources/qml/Avatar.qml
index 108bb76..75971a3 100644
--- a/resources/qml/Avatar.qml
+++ b/resources/qml/Avatar.qml
@@ -60,18 +60,6 @@ Rectangle {
 
         }
 
-        layer.effect: OpacityMask {
-            cached: true
-
-            maskSource: Rectangle {
-                anchors.fill: parent
-                width: avatar.width
-                height: avatar.height
-                radius: Settings.avatarCircles ? height / 2 : 3
-            }
-
-        }
-
     }
 
     Rectangle {
-- 
2.30.0


From 0aa02aa568eaa2ff46e52192d25f7149c9430fee Mon Sep 17 00:00:00 2001
From: Pascal Abresch <nep@packageloss.eu>
Date: Sat, 24 Apr 2021 07:51:50 +0200
Subject: Haiku: decrease single pane threshold


diff --git a/src/Splitter.cpp b/src/Splitter.cpp
index 15e3f5c..aaf67e1 100644
--- a/src/Splitter.cpp
+++ b/src/Splitter.cpp
@@ -160,7 +160,7 @@ splitter::calculateSidebarSizes(const QFont &f)
         sz.small         = std::ceil(3.8 * height);
         sz.normal        = std::ceil(16 * height);
         sz.groups        = std::ceil(3 * height);
-        sz.collapsePoint = 2 * sz.normal;
+        sz.collapsePoint = 1.4 * sz.normal;
 
         return sz;
 }
-- 
2.30.0


From 919142c89739e63a18b286d14bba4deb7fb07e4a Mon Sep 17 00:00:00 2001
From: Pascal Abresch <nep@packageloss.eu>
Date: Sat, 24 Apr 2021 07:40:14 +0200
Subject: Haiku: disable singleapplication


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 468480d..2d8bcb3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -461,9 +461,11 @@ else()
 	add_feature_info(voip OFF "GStreamer could not be found on your system.  As a consequence call support has been disabled. If you don't want that, make sure gstreamer-sdp-1.0>=1.18 gstreamer-webrtc-1.0>=1.18 can be found via pkgconfig.")
 endif()
 
+if(NOT HAIKU)
 # single instance functionality
 set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication")
 add_subdirectory(third_party/SingleApplication-3.2.0-dc8042b/)
+endif()
 
 feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
 
@@ -633,8 +635,12 @@ target_link_libraries(nheko PRIVATE
 	qt5keychain
 	nlohmann_json::nlohmann_json
 	lmdbxx::lmdbxx
-	liblmdb::lmdb
+	liblmdb::lmdb)
+
+if (NOT HAIKU)
+target_link_libraries(nheko PRIVATE
 	SingleApplication::SingleApplication)
+endif()
 
 if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
 target_precompile_headers(nheko
diff --git a/src/main.cpp b/src/main.cpp
index fe1a9ee..446e165 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -29,7 +29,10 @@
 #include "MatrixClient.h"
 #include "Utils.h"
 #include "config/nheko.h"
+
+#if !defined(Q_OS_HAIKU)
 #include "singleapplication.h"
+#endif
 
 #if defined(Q_OS_MAC)
 #include "emoji/MacHelper.h"
@@ -136,6 +139,7 @@ main(int argc, char *argv[])
                 }
         }
 
+#if !defined(Q_OS_HAIKU)
         SingleApplication app(argc,
                               argv,
                               true,
@@ -145,12 +149,17 @@ main(int argc, char *argv[])
                                 SingleApplication::Mode::SecondaryNotification,
                               100,
                               userdata);
+#else
+        QApplication app(argc, argv, true);
+#endif
 
+#if !defined(Q_OS_HAIKU)
         if (app.isSecondary()) {
                 // open uri in main instance
                 app.sendMessage(matrixUri.toUtf8());
                 return 0;
         }
+#endif
 
         QCommandLineParser parser;
         parser.addHelpOption();
@@ -170,9 +179,11 @@ main(int argc, char *argv[])
           QCoreApplication::tr("profile name"));
         parser.addOption(configName);
 
+#if !defined(Q_OS_HAIKU)
         parser.process(app);
 
         app.setWindowIcon(QIcon::fromTheme("nheko", QIcon{":/logos/nheko.png"}));
+#endif
 
         http::init();
 
@@ -236,6 +247,8 @@ main(int argc, char *argv[])
                         nhlog::net()->debug("bye");
                 }
         });
+
+#if !defined(Q_OS_HAIKU)
         QObject::connect(&app, &SingleApplication::instanceStarted, &w, [&w]() {
                 w.show();
                 w.raise();
@@ -247,9 +260,14 @@ main(int argc, char *argv[])
           &SingleApplication::receivedMessage,
           ChatPage::instance(),
           [&](quint32, QByteArray message) { ChatPage::instance()->handleMatrixUri(message); });
-
+#endif
         QMetaObject::Connection uriConnection;
+
+#if !defined(Q_OS_HAIKU)
         if (app.isPrimary() && !matrixUri.isEmpty()) {
+#else
+        if (!matrixUri.isEmpty()) {
+#endif
                 uriConnection = QObject::connect(ChatPage::instance(),
                                                  &ChatPage::contentLoaded,
                                                  ChatPage::instance(),
-- 
2.30.0

