From d41c4e88e7b14d99a9b1089e8fcff9be1b6aca29 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 22 Aug 2018 19:35:17 +1000
Subject: Fix build for Haiku


diff --git a/qPutty.pri b/qPutty.pri
index ceaca0d..f6b627c 100644
--- a/qPutty.pri
+++ b/qPutty.pri
@@ -126,7 +126,11 @@ win32{
     }
 } else {
     INCLUDEPATH *= $$PUTTY_HOME/unix
+haiku {
+	LIBS *= -lnetwork
+} else {
     LIBS *= -ldl -lX11
+}
     QMAKE_CXXFLAGS *= -Wno-write-strings
     SOURCES *= $$PUTTY_HOME/time.c \ 
             $$PUTTY_HOME/unix/ux_x11.c \
diff --git a/qPutty.pro b/qPutty.pro
index 31c7217..aa0dc31 100644
--- a/qPutty.pro
+++ b/qPutty.pro
@@ -30,7 +30,9 @@ unix {
     desktopEntry.files = qPutty.desktop
 
     target.path = $$PREFIX/bin
+!haiku {
     QT+=x11extras
+}
     INSTALLS+=target desktopEntry
 }
 
diff --git a/qtwin.cpp b/qtwin.cpp
index aa2a09d..10c87d0 100644
--- a/qtwin.cpp
+++ b/qtwin.cpp
@@ -44,11 +44,16 @@ typedef WId WID;
 typedef long WID;
 #endif
 
+#ifdef Q_OS_HAIKU
+#define DEFAULT_FONT "Noto Mono,10"
+typedef long WID;
+#else
 #ifdef Q_OS_UNIX
 #include <QX11Info>
 #define DEFAULT_FONT "Courier New,10"
 typedef long WID;
 #endif
+#endif
 
 #include <QDebug>
 #include <QFont>
@@ -72,9 +77,11 @@ extern "C" {
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+#ifndef Q_OS_HAIKU
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
+#endif
 extern int use_pty_argv;
 #else
     char *do_select(SOCKET skt, int startup);
@@ -642,7 +649,7 @@ void cmdline_error(const char *p, ...)
 
 char *gdk_get_display()
 {
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_HAIKU)
     return (char*)QX11Info::display();
 #else
     return 0;
@@ -767,7 +774,7 @@ int do_cmdline(int argc, char **argv, int do_everything, int *allow_launch,
         conf_set_str(conf, CONF_line_codepage, val);
 
 	} else if (!strcmp(p, "-geometry")) {
-#ifdef Q_OS_UNIX
+#if defined(Q_OS_UNIX) && !defined(Q_OS_HAIKU)
 	    int flags, x, y;
 	    unsigned int w, h;
 	    EXPECTS_ARG;
@@ -942,6 +949,8 @@ void setup_fonts_ucs(struct gui_data *inst)
     switch(conf_get_int(inst->conf, CONF_font_quality))
     {
         case FQ_DEFAULT:
+			aa=QFont::PreferAntialias;
+			break;
         case FQ_NONANTIALIASED:
             aa=QFont::NoAntialias;
             break;
-- 
2.16.4


From cadbfedfdd5cb6b22441aedd04965c332dccda3f Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 22 Aug 2018 22:07:01 +1000
Subject: Disable window icon


diff --git a/putty.cpp b/putty.cpp
index 771e0d5..11822fc 100644
--- a/putty.cpp
+++ b/putty.cpp
@@ -28,8 +28,9 @@
 int main(int argc, char **argv)
 {
     QApplication app(argc, argv);
+#ifndef Q_OS_HAIKU
     app.setWindowIcon(QIcon::fromTheme(QStringLiteral("qputty")));
-
+#endif
     QPutty p;
     int ret=p.run(app.arguments());
     if(ret<1) exit(ret);
-- 
2.16.4

