diff --git a/ChangeLog b/ChangeLog
index 246288c..627e094 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-11-30 (0.8.9)  Robin Gareus <robin@gareus.org>
+* prefer -pthread over -lpthread, fixes #18
+* mainly a build-system, binary only update
+
+2018-06-06 (0.8.8)  Robin Gareus <robin@gareus.org>
+* use PortMidi default device (allow using portmidisetup)
+* fix loading fonts with non ASCII paths on Windows
+* allow verbose/debug logging on windows
+
 2016-11-28 (0.8.7)  Robin Gareus <robin@gareus.org>
 * fix release builds (mistake in 0.8.6)
 
diff --git a/config.guess b/config.guess
index 0967f2a..2e9ad7f 100755
--- a/config.guess
+++ b/config.guess
@@ -2,7 +2,7 @@
 # Attempt to guess a canonical system name.
 #   Copyright 1992-2016 Free Software Foundation, Inc.
 
-timestamp='2016-04-02'
+timestamp='2016-10-02'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
 	esac
 	# The Operating System including object format, if it has switched
-	# to ELF recently, or will in the future.
+	# to ELF recently (or will in the future) and ABI.
 	case "${UNAME_MACHINE_ARCH}" in
-	    arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
+	    earm*)
+		os=netbsdelf
+		;;
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
 		eval $set_cc_for_build
 		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
 			| grep -q __ELF__
@@ -997,6 +1000,9 @@ EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
 	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
+    mips64el:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     openrisc*:Linux:*:*)
 	echo or1k-unknown-linux-${LIBC}
 	exit ;;
@@ -1029,6 +1035,9 @@ EOF
     ppcle:Linux:*:*)
 	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
+    riscv32:Linux:*:* | riscv64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
 	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
@@ -1408,18 +1417,17 @@ esac
 cat >&2 <<EOF
 $0: unable to guess system type
 
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
 
   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
 and
   http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
 
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches@gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches@gnu.org to
+provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
diff --git a/config.h b/config.h
index 902fa14..cf60fcf 100644
--- a/config.h
+++ b/config.h
@@ -105,7 +105,7 @@
 #define HAVE_PTHREAD_H 1
 
 /* Define as 1 if you have the SDL toolkit (linux,netbsd,osx,win) */
-#define HAVE_SDL 1
+/* #undef HAVE_SDL */
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #define HAVE_STDINT_H 1
@@ -226,7 +226,7 @@
 /* #undef TTFFONTFILE */
 
 /* Version number of package */
-#define VERSION "0.8.7"
+#define VERSION "0.8.9"
 
 /* enable xjadeo windows context-menu */
 #define WINMENU 1
diff --git a/config.sub b/config.sub
index 8d39c4b..dd2ca93 100755
--- a/config.sub
+++ b/config.sub
@@ -2,7 +2,7 @@
 # Configuration validation subroutine script.
 #   Copyright 1992-2016 Free Software Foundation, Inc.
 
-timestamp='2016-03-30'
+timestamp='2016-11-04'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -117,7 +117,7 @@ case $maybe_os in
   nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
   linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
   knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | \
+  kopensolaris*-gnu* | cloudabi*-eabi* | \
   storm-chaos* | os2-emx* | rtmk-nova*)
     os=-$maybe_os
     basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -301,6 +301,7 @@ case $basic_machine in
 	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
+	| pru \
 	| pyramid \
 	| riscv32 | riscv64 \
 	| rl78 | rx \
@@ -428,6 +429,7 @@ case $basic_machine in
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+	| pru-* \
 	| pyramid-* \
 	| riscv32-* | riscv64-* \
 	| rl78-* | romp-* | rs6000-* | rx-* \
@@ -643,6 +645,14 @@ case $basic_machine in
 		basic_machine=m68k-bull
 		os=-sysv3
 		;;
+	e500v[12])
+		basic_machine=powerpc-unknown
+		os=$os"spe"
+		;;
+	e500v[12]-*)
+		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=$os"spe"
+		;;
 	ebmon29k)
 		basic_machine=a29k-amd
 		os=-ebmon
@@ -1022,7 +1032,7 @@ case $basic_machine in
 	ppc-* | ppcbe-*)
 		basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	ppcle | powerpclittle | ppc-le | powerpc-little)
+	ppcle | powerpclittle)
 		basic_machine=powerpcle-unknown
 		;;
 	ppcle-* | powerpclittle-*)
@@ -1032,7 +1042,7 @@ case $basic_machine in
 		;;
 	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
 		;;
-	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+	ppc64le | powerpc64little)
 		basic_machine=powerpc64le-unknown
 		;;
 	ppc64le-* | powerpc64little-*)
@@ -1389,7 +1399,7 @@ case $os in
 	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
 	      | -chorusos* | -chorusrdb* | -cegcc* \
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+	      | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
 	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
@@ -1399,7 +1409,7 @@ case $os in
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
 	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-	      | -onefs* | -tirtos*)
+	      | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
diff --git a/configure b/configure
index 03b01f8..d06ad54 100755
--- a/configure
+++ b/configure
@@ -2740,7 +2740,7 @@ test -n "$target_alias" &&
 
 VERSION_MAJOR=0
 VERSION_MINOR=8
-VERSION_SUB=7
+VERSION_SUB=9
 
 am__api_version='1.15'
 
@@ -6860,7 +6860,7 @@ fi
 $as_echo "$ac_cv_lib_rt_mq_open" >&6; }
 if test "x$ac_cv_lib_rt_mq_open" = xyes; then :
   $as_echo "#define HAVE_MQ 1" >>confdefs.h
- MQ_LIBS="-lrt -lpthread" HAVE_MQ=1
+ MQ_LIBS="-lrt" HAVE_MQ=1
 fi
 
 fi
@@ -7544,7 +7544,7 @@ fi
 		HAVE_MIDI=1
 		ALSA_SEQ_MIDI=1
 		ALSA_RAW_MIDI=1
-		MIDI_LIBS="$MIDI_LIBS -lasound -lpthread"
+		MIDI_LIBS="$MIDI_LIBS -lasound"
 	fi
 	if test "x$FOUND_H_PORTMIDI$FOUND_L_PORTMIDI" = "xyesyes"; then
 		$as_echo "#define HAVE_MIDI 1" >>confdefs.h
diff --git a/configure.ac b/configure.ac
index a0afb87..5bca424 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,7 +8,7 @@ AC_CANONICAL_TARGET
 
 VERSION_MAJOR=0
 VERSION_MINOR=8
-VERSION_SUB=7
+VERSION_SUB=9
 
 AM_INIT_AUTOMAKE(xjadeo, [${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_SUB}])
 AM_CONFIG_HEADER(config.h)
@@ -229,7 +229,7 @@ dnl ---------------------------------------------------------------------------
 dnl remote control..
 MQ_LIBS=""
 if test "x$enable_mq" != "xno"; then
-	AC_CHECK_LIB(rt, mq_open, [AC_DEFINE(HAVE_MQ) MQ_LIBS="-lrt -lpthread" HAVE_MQ=1])
+	AC_CHECK_LIB(rt, mq_open, [AC_DEFINE(HAVE_MQ) MQ_LIBS="-lrt" HAVE_MQ=1])
 fi
 AC_SUBST(MQ_LIBS)
 AC_DEFINE(MQLEN, 512, [ max length of a remote control line. ])
@@ -321,7 +321,7 @@ dnl TODO check if porttime is needed for threading
 		HAVE_MIDI=1
 		ALSA_SEQ_MIDI=1
 		ALSA_RAW_MIDI=1
-		MIDI_LIBS="$MIDI_LIBS -lasound -lpthread"
+		MIDI_LIBS="$MIDI_LIBS -lasound"
 	fi
 	if test "x$FOUND_H_PORTMIDI$FOUND_L_PORTMIDI" = "xyesyes"; then
 		AC_DEFINE(HAVE_MIDI)
diff --git a/debian/changelog b/debian/changelog
index 28ed311..f3c2475 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xjadeo (0.8.9-1) UNRELEASED; urgency=medium
+
+  * New upstream release.
+
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 05 Aug 2019 03:55:39 +0000
+
 xjadeo (0.8.7-2) unstable; urgency=medium
 
   * Use upstream hi-resolution icon.
diff --git a/doc/xjadeo.1 b/doc/xjadeo.1
index 1c871f9..6c599dc 100644
--- a/doc/xjadeo.1
+++ b/doc/xjadeo.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
-.TH XJADEO "1" "November 2016" "xjadeo version 0.8.7" "User Commands"
+.TH XJADEO "1" "December 2018" "xjadeo version 0.8.9" "User Commands"
 .SH NAME
 xjadeo \- X Jack Video Monitor
 .SH SYNOPSIS
@@ -356,14 +356,14 @@ Report bugs at <https://github.com/x42/xjadeo/issues>
 Website: <http://xjadeo.sf.net/>
 .TP
 built from:
-scm\-v0.8.7
+scm\-v0.8.9
 .IP
-compiled with: AVFORMAT=0x392964 AVCODEC=0x393065 AVUTIL:0x371c64
+compiled with: AVFORMAT=0x393865 AVCODEC=0x394065 AVUTIL:0x372265
 configuration: [ LTC JACK\-SESSION POSIX\-MQueue OSC ]
 .br
 MTC/MIDI:      [ jack\-midi alsa\-sequencer portmidi alsa\-raw ]
 .br
-Display(s):    [ openGL Xv SDL X11/imlib2(RGBA32) ]
+Display(s):    [ openGL Xv X11/imlib2(RGBA32) ]
 .SH COPYRIGHT
 Copyright \(co GPL 2006\-2015 Robin Gareus <robin@gareus.org>
 .br
diff --git a/doc/xjremote.1 b/doc/xjremote.1
index b57e482..db43798 100644
--- a/doc/xjremote.1
+++ b/doc/xjremote.1
@@ -1,5 +1,5 @@
 .\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
-.TH XJREMOTE "1" "November 2016" "xjremote version 0.8.7" "User Commands"
+.TH XJREMOTE "1" "December 2018" "xjremote version 0.8.9" "User Commands"
 .SH NAME
 xjremote \- X Jack Video Monitor Remote Control
 .SH SYNOPSIS
@@ -54,7 +54,7 @@ Report bugs to Robin Gareus <robin@gareus.org>
 Website: <https://github.com/x42/xjadeo>
 .TP
 built from:
-scm\-v0.8.7
+scm\-v0.8.9
 .TP
 configuration:
 [ POSIX\-MQueue ]
diff --git a/src/qt-gui/qjadeo_fr.ts b/src/qt-gui/qjadeo_fr.ts
index 3247fb9..8bfd346 100644
--- a/src/qt-gui/qjadeo_fr.ts
+++ b/src/qt-gui/qjadeo_fr.ts
@@ -5,11 +5,11 @@
     <name>ImportDialog</name>
     <message>
         <source>Import - Convert Video File</source>
-        <translation>Importer - Convertir Fichier Video</translation>
+        <translation>Importer - convertir un fichier vidéo</translation>
     </message>
     <message>
         <source>Video File</source>
-        <translation>Fichier Video</translation>
+        <translation>Fichier vidéo</translation>
     </message>
     <message>
         <source>Source:</source>
@@ -17,7 +17,7 @@
     </message>
     <message>
         <source>File Info:</source>
-        <translation>Info Fichier :</translation>
+        <translation>Info sur le fichier :</translation>
     </message>
     <message>
         <source>Destination:</source>
@@ -25,7 +25,7 @@
     </message>
     <message>
         <source>Encoder Settings</source>
-        <translation>Paramètres de l&apos;Encodeur</translation>
+        <translation>Paramètres de l&apos;encodeur</translation>
     </message>
     <message>
         <source>Width:</source>
@@ -33,7 +33,7 @@
     </message>
     <message>
         <source>Scale</source>
-        <translation>Echelle</translation>
+        <translation>Échelle</translation>
     </message>
     <message>
         <source>Height:</source>
@@ -41,7 +41,7 @@
     </message>
     <message>
         <source>Break Aspect Ratio</source>
-        <translation>Casser le Ratio d&apos;Aspect</translation>
+        <translation>Casser le ratio d&apos;aspect</translation>
     </message>
     <message>
         <source>FPS:</source>
@@ -65,7 +65,7 @@
     </message>
     <message>
         <source>Resample</source>
-        <translation>Rééchantillonner</translation>
+        <translation>Ré-échantillonner</translation>
     </message>
     <message>
         <source>extra mencoder options</source>
@@ -92,7 +92,7 @@
     <name>ImportProgress</name>
     <message>
         <source>Transcoding Video File</source>
-        <translation>Transcodage du Fichier Video</translation>
+        <translation>Transcodage du fichier vidéo</translation>
     </message>
     <message>
         <source>Cancel</source>
@@ -155,7 +155,7 @@
     </message>
     <message>
         <source>&amp;Close xjadeo and Exit</source>
-        <translation>&amp;Fermer xjadeo et Quitter</translation>
+        <translation>&amp;Fermer xjadeo et quitter</translation>
     </message>
     <message>
         <source>About</source>
@@ -203,7 +203,7 @@
     </message>
     <message>
         <source>Frame number</source>
-        <translation>Numéro de Trame</translation>
+        <translation>Numéro de trame</translation>
     </message>
     <message>
         <source>Box</source>
@@ -243,7 +243,7 @@
     </message>
     <message>
         <source>Disconnect and &amp;Exit</source>
-        <translation>Déconnecter et &amp;Quitter</translation>
+        <translation>Déconnecter et &amp;quitter</translation>
     </message>
     <message>
         <source>to any frame</source>
@@ -271,7 +271,7 @@
     </message>
     <message>
         <source>Letterbox</source>
-        <translation>Letterbox</translation>
+        <translation>Boîte aux lettres</translation>
     </message>
     <message>
         <source>Resize to aspect-ratio</source>
@@ -294,11 +294,11 @@
     </message>
     <message>
         <source>Autoconnect ALSA Midi port (MTC):</source>
-        <translation>Se connecter automatiquement ce port ALSA Midi (MTC) :</translation>
+        <translation>Se connecter automatiquement au port ALSA Midi (MTC) :</translation>
     </message>
     <message>
         <source>Autoconnect JACK Midi port (MTC):</source>
-        <translation>Se connecter automatiquement ce port JACK Midi (MTC) :</translation>
+        <translation>Se connecter automatiquement au port JACK Midi (MTC) :</translation>
     </message>
     <message>
         <source>xjadeo/xjremote executable:</source>
@@ -314,11 +314,11 @@
     </message>
     <message>
         <source>Import Settings</source>
-        <translation>Paramètres d&apos;Importation</translation>
+        <translation>Paramètres d&apos;importation</translation>
     </message>
     <message>
         <source>Import to Codec:</source>
-        <translation>Importer vers le Codec :</translation>
+        <translation>Importer vers le codec :</translation>
     </message>
     <message>
         <source>mpeg4</source>
diff --git a/src/xjadeo/Makefile.am b/src/xjadeo/Makefile.am
index 8b4be50..e69dd1f 100644
--- a/src/xjadeo/Makefile.am
+++ b/src/xjadeo/Makefile.am
@@ -21,9 +21,9 @@ xjadeo_SOURCES=main.c ../../aclocal.m4 ../../config.h \
 
 xjadeo_LDADD = @MQ_LIBS@ @FFMPEG_LIBS@ @XV_LIBS@ @MIDI_LIBS@ @FREETYPE_LIBS@ @IMLIB2_LIBS@ @XPM_LIBS@ @LIBLO_LIBS@ @SDL_LIBS@ @LTC_LIBS@ @GL_LIBS@ -lm
 
-xjadeo_CFLAGS = -Wall -g -O3 \
+xjadeo_CFLAGS = -Wall -g -O3 -pthread \
 	@FFMPEG_CFLAGS@ @XV_CFLAGS@ @MIDI_CFLAGS@ @FREETYPE_CFLAGS@ @IMLIB2_CFLAGS@ @XPM_CFLAGS@ @LIBLO_CFLAGS@ @SDL_CFLAGS@ @LTC_CFLAGS@ @GL_CFLAGS@ @JACK_CFLAGS@ "-DSUBVERSION=\"$(REV)\"" "-DSHAREDIR=\"$(datadir)\""
-xjadeo_OBJCFLAGS = -Wall -g -O3 \
+xjadeo_OBJCFLAGS = -Wall -g -O3 -pthread \
 	@FFMPEG_CFLAGS@ @XV_CFLAGS@ @MIDI_CFLAGS@ @FREETYPE_CFLAGS@ @IMLIB2_CFLAGS@ @XPM_CFLAGS@ @LIBLO_CFLAGS@ @SDL_CFLAGS@ @LTC_CFLAGS@ @GL_CFLAGS@ @JACK_CFLAGS@ "-DSUBVERSION=\"$(REV)\""
 
 if TARGET_LINUX
@@ -48,7 +48,7 @@ endif
 
 xjremote_SOURCES = xjremote.c
 
-xjremote_CFLAGS = "-DSUBVERSION=\"$(REV)\""
+xjremote_CFLAGS = -pthread "-DSUBVERSION=\"$(REV)\""
 
 xjremote_LDADD = @MQ_LIBS@
 
diff --git a/src/xjadeo/Makefile.in b/src/xjadeo/Makefile.in
index dafc644..5f6e681 100644
--- a/src/xjadeo/Makefile.in
+++ b/src/xjadeo/Makefile.in
@@ -407,17 +407,18 @@ xjadeo_LDADD = @MQ_LIBS@ @FFMPEG_LIBS@ @XV_LIBS@ @MIDI_LIBS@ \
 	@SDL_LIBS@ @LTC_LIBS@ @GL_LIBS@ -lm $(am__append_2) \
 	$(am__append_4) $(am__append_7) $(am__append_10) \
 	$(am__append_11)
-xjadeo_CFLAGS = -Wall -g -O3 @FFMPEG_CFLAGS@ @XV_CFLAGS@ @MIDI_CFLAGS@ \
-	@FREETYPE_CFLAGS@ @IMLIB2_CFLAGS@ @XPM_CFLAGS@ @LIBLO_CFLAGS@ \
-	@SDL_CFLAGS@ @LTC_CFLAGS@ @GL_CFLAGS@ @JACK_CFLAGS@ \
-	"-DSUBVERSION=\"$(REV)\"" "-DSHAREDIR=\"$(datadir)\"" \
-	$(am__append_6) $(am__append_9) $(am__append_12)
-xjadeo_OBJCFLAGS = -Wall -g -O3 \
+xjadeo_CFLAGS = -Wall -g -O3 -pthread @FFMPEG_CFLAGS@ @XV_CFLAGS@ \
+	@MIDI_CFLAGS@ @FREETYPE_CFLAGS@ @IMLIB2_CFLAGS@ @XPM_CFLAGS@ \
+	@LIBLO_CFLAGS@ @SDL_CFLAGS@ @LTC_CFLAGS@ @GL_CFLAGS@ \
+	@JACK_CFLAGS@ "-DSUBVERSION=\"$(REV)\"" \
+	"-DSHAREDIR=\"$(datadir)\"" $(am__append_6) $(am__append_9) \
+	$(am__append_12)
+xjadeo_OBJCFLAGS = -Wall -g -O3 -pthread \
 	@FFMPEG_CFLAGS@ @XV_CFLAGS@ @MIDI_CFLAGS@ @FREETYPE_CFLAGS@ @IMLIB2_CFLAGS@ @XPM_CFLAGS@ @LIBLO_CFLAGS@ @SDL_CFLAGS@ @LTC_CFLAGS@ @GL_CFLAGS@ @JACK_CFLAGS@ "-DSUBVERSION=\"$(REV)\""
 
 @TARGET_WIN32_TRUE@xjadeo_LDFLAGS = -mwindows
 xjremote_SOURCES = xjremote.c
-xjremote_CFLAGS = "-DSUBVERSION=\"$(REV)\""
+xjremote_CFLAGS = -pthread "-DSUBVERSION=\"$(REV)\""
 xjremote_LDADD = @MQ_LIBS@
 MAINTAINERCLEANFILES = Makefile.in
 CLEANFILES = paths.h
diff --git a/src/xjadeo/display_gl_win.c b/src/xjadeo/display_gl_win.c
index 60d43f0..8d95cf2 100644
--- a/src/xjadeo/display_gl_win.c
+++ b/src/xjadeo/display_gl_win.c
@@ -1008,10 +1008,10 @@ void gl_mousepointer (int action) {
 	if (action==2) hide_mouse ^= 1;
 	else hide_mouse = action ? 1 : 0;
 	if (hide_mouse) {
-		SetClassLong(_gl_hwnd, GCL_HCURSOR, (LONG)hCurs_none);
+		SetClassLong(_gl_hwnd, GCLP_HCURSOR, (LONG)hCurs_none);
 		SetCursor(hCurs_none);
 	} else {
-		SetClassLong(_gl_hwnd, GCL_HCURSOR, (LONG)hCurs_dflt);
+		SetClassLong(_gl_hwnd, GCLP_HCURSOR, (LONG)hCurs_dflt);
 		SetCursor(hCurs_dflt);
 	}
 }
diff --git a/src/xjadeo/main.c b/src/xjadeo/main.c
index 2c54fc8..a5b886d 100644
--- a/src/xjadeo/main.c
+++ b/src/xjadeo/main.c
@@ -949,6 +949,62 @@ static void *xjadeo (void *arg) {
 	return NULL;
 }
 
+#if defined PLATFORM_WINDOWS
+static FILE* pStdOut = 0;
+static FILE* pStdErr = 0;
+static BOOL  bConsole;
+static HANDLE hStdOut;
+
+static int
+IsAConsolePort (HANDLE handle)
+{
+	DWORD mode;
+	return (GetConsoleMode(handle, &mode) != 0);
+}
+
+static void
+console_madness_begin ()
+{
+	bConsole = AttachConsole(ATTACH_PARENT_PROCESS);
+	hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+
+	/* re-attach to the console so we can see 'printf()' output etc.  */
+	if ((bConsole) && (IsAConsolePort(hStdOut))) {
+		pStdOut = freopen( "CONOUT$", "w", stdout );
+		pStdErr = freopen( "CONOUT$", "w", stderr );
+	}
+}
+
+static void
+console_madness_end ()
+{
+	if (pStdOut) {
+		fclose (pStdOut);
+	}
+	if (pStdErr) {
+		fclose (pStdErr);
+	}
+
+	if (bConsole) {
+		/* Detach and free the console from our application, and line feed */
+		INPUT_RECORD input_record;
+
+		input_record.EventType = KEY_EVENT;
+		input_record.Event.KeyEvent.bKeyDown = TRUE;
+		input_record.Event.KeyEvent.dwControlKeyState = 0;
+		input_record.Event.KeyEvent.uChar.UnicodeChar = VK_RETURN;
+		input_record.Event.KeyEvent.wRepeatCount      = 1;
+		input_record.Event.KeyEvent.wVirtualKeyCode   = VK_RETURN;
+		input_record.Event.KeyEvent.wVirtualScanCode  = MapVirtualKey( VK_RETURN, 0 );
+
+		DWORD written = 0;
+		WriteConsoleInput( GetStdHandle( STD_INPUT_HANDLE ), &input_record, 1, &written );
+
+		FreeConsole();
+	}
+}
+#endif
+
 
 #if defined PLATFORM_WINDOWS && defined USE_WINMAIN
 
@@ -1003,6 +1059,10 @@ int main (int argc, char **argv)
 	int i;
 	char *movie;
 
+#ifdef PLATFORM_WINDOWS
+	console_madness_begin ();
+#endif
+
 	xjadeorc(); // read config files - default values before parsing cmd line.
 
 #ifdef PLATFORM_OSX
@@ -1062,7 +1122,7 @@ int main (int argc, char **argv)
 			strcpy(OSD_fontfile, path);
 			strcat(OSD_fontfile, "\\" FONT_FILE);
 		} else {
-			GetModuleFileNameW(NULL, (LPWCH)path, MAX_PATH);
+			GetModuleFileName(NULL, (LPWCH)path, MAX_PATH);
 			char *tmp;
 			if ((tmp = strrchr(path, '\\'))) *tmp = 0;
 			strcpy(OSD_fontfile, path);
@@ -1115,5 +1175,9 @@ int main (int argc, char **argv)
 #endif
 
 	clean_up(0);
+
+#ifdef PLATFORM_WINDOWS
+	console_madness_end ();
+#endif
 	return (0);
 }
diff --git a/src/xjadeo/midi.c b/src/xjadeo/midi.c
index 1b6e40f..d1c5e18 100644
--- a/src/xjadeo/midi.c
+++ b/src/xjadeo/midi.c
@@ -232,24 +232,22 @@ PmStream * pm_midi = NULL;
 #define INPUT_BUFFER_SIZE 0
 
 static int pm_midi_detectdevices (int print) {
-	int midiid=-1;
 	int i;
-
-	// id = Pm_GetDefaultInputDeviceID(); <- use this as default ??
+	int midiid = Pm_GetDefaultInputDeviceID();
 
 	/* list device information */
 	for (i = 0; i < Pm_CountDevices(); i++) {
 		const PmDeviceInfo *info = Pm_GetDeviceInfo(i);
 
 		if (info->input) {
-			if(midiid==-1) { midiid=i; }
+			if(midiid == pmNoDevice) { midiid=i; }
 		}
 
 		if (print) {
 			printf("%d: %s, %s", i, info->interf, info->name);
 			if (info->input) printf(" (input)");
 			if (info->output) printf(" (output)");
-			if(midiid==i)  printf(" (*)");
+			if(midiid == i)  printf(" (*)");
 			printf("\n");
 		}
 	}
diff --git a/src/xjadeo/mqueue.c b/src/xjadeo/mqueue.c
index 8f36523..5ad84a3 100644
--- a/src/xjadeo/mqueue.c
+++ b/src/xjadeo/mqueue.c
@@ -23,6 +23,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <unistd.h>
 #include <stdarg.h>