summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--.travis.yml2
-rw-r--r--configure.ac20
-rw-r--r--osx/Info.plist.in (renamed from osx/Info.plist)6
-rw-r--r--osx/hexchat.bundle6
-rwxr-xr-xosx/launcher.sh8
-rwxr-xr-xosx/makebundle.sh4
-rw-r--r--plugins/Makefile.am8
-rw-r--r--plugins/checksum/checksum.c5
-rw-r--r--plugins/fishlim/fish.c5
-rw-r--r--src/common/Makefile.am6
-rw-r--r--src/common/cfgfiles.c2
-rw-r--r--src/common/hexchat.h7
-rw-r--r--src/common/plugin.c42
-rw-r--r--src/common/servlist.c12
-rw-r--r--src/common/ssl.c5
-rw-r--r--src/fe-gtk/Makefile.am4
-rw-r--r--src/fe-gtk/servlistgui.c24
-rw-r--r--src/fe-gtk/xtext.c38
-rw-r--r--src/htm/Makefile.am9
20 files changed, 162 insertions, 52 deletions
diff --git a/.gitignore b/.gitignore
index adaf4090..a82e37f5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,6 +37,7 @@ po/Makefile.in.in
 po/POTFILES
 po/remove-potcdate.sed
 po/stamp-*
+osx/Info.plist
 data/pkgconfig/hexchat-plugin.pc
 data/misc/hexchat.appdata.xml
 src/common/dbus/example
diff --git a/.travis.yml b/.travis.yml
index 0dd68467..39696244 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,7 +6,7 @@ before_script:
 script: 
     - ./autogen.sh
     - ./configure --enable-textfe --with-theme-manager
-    - make
+    - make V=1
 notifications:
     irc:
         channels: "chat.freenode.net#hexchat-devel"
diff --git a/configure.ac b/configure.ac
index 0ff129b0..ccede768 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,25 +293,31 @@ if test "x$python" != xno ; then
 		case $python in
 			dnl set python2 default here
 			python2)
-				PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_ERROR(Cannot find python-2.7!)])
+				PKG_CHECK_MODULES([PY], [python-2.7], [], [AC_MSG_WARN(Cannot find python-2.7!)])
 				PY_VER="`$PKG_CONFIG --modversion python-2.7`";;
 			dnl set python3 default here
 			python3)
-				PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_ERROR(Cannot find python-3.3!)])
+				PKG_CHECK_MODULES([PY], [python-3.3], [], [AC_MSG_WARN(Cannot find python-3.3!)])
 				PY_VER="`$PKG_CONFIG --modversion python-3.3`";;
 			dnl add broken versions here
 			python2.5|python2.6|python3.1|python3.2)
 				AC_MSG_ERROR(Unsupported Python version ${python}!);;
 			python*)
 				python="python-${python#python}" # stay posix compliant
-				PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_ERROR(Cannot find "${python}.pc"!)])
+				PKG_CHECK_MODULES([PY], [${python}], [], [AC_MSG_WARN(Cannot find "${python}.pc"!)])
 				PY_VER="`$PKG_CONFIG --modversion ${python}`";;
 			*)
-				AC_MSG_ERROR(Unsupported Python ${python}!)
+				AC_MSG_WARN(Unsupported Python ${python}!)
 		esac
 		AC_MSG_CHECKING(Python version)
-		AC_MSG_RESULT($PY_VER)
-		python="python-${PY_VER}"
+
+		if test "$PY_VER"; then
+			AC_MSG_RESULT($PY_VER)
+			python="python-${PY_VER}"
+		else
+			AC_MSG_RESULT(Not found)
+			python=no
+		fi
 	else
 		AC_MSG_RESULT([plugins are disabled, use the --enable-plugin option for Python])
 		python=no
@@ -594,6 +600,7 @@ dnl *********************************************************************
 AM_CONDITIONAL(USE_OPENSSL, test "x$openssl" = "xyes")
 AM_CONDITIONAL(USE_LIBNOTIFY, test "x$libnotify" = "xyes")
 AM_CONDITIONAL(USE_LIBCANBERRA, test "x$libcanberra" = "xyes")
+AM_CONDITIONAL(USE_MSPROXY, test "x$ntlm" = "xyes")
 AM_CONDITIONAL(DO_TEXT, test "x$textfe" = "xyes")
 AM_CONDITIONAL(DO_GTK, test "x$gtkfe" = "xyes")
 AM_CONDITIONAL(DO_PERL, test "x$perl" = "xyes")
@@ -831,6 +838,7 @@ src/fe-text/Makefile
 src/fe-gtk/Makefile
 src/htm/Makefile
 src/htm/thememan
+osx/Info.plist
 plugins/Makefile
 plugins/python/Makefile
 plugins/perl/Makefile
diff --git a/osx/Info.plist b/osx/Info.plist.in
index 06469a5e..2ee15897 100644
--- a/osx/Info.plist
+++ b/osx/Info.plist.in
@@ -7,7 +7,7 @@
     <key>CFBundleExecutable</key>
     <string>HexChat</string>
     <key>CFBundleGetInfoString</key>
-    <string>2.9.6</string>
+    <string>@VERSION@</string>
     <key>CFBundleIconFile</key>
     <string>hexchat.icns</string>
     <key>CFBundleIdentifier</key>
@@ -17,11 +17,11 @@
     <key>CFBundlePackageType</key>
     <string>APPL</string>
     <key>CFBundleShortVersionString</key>
-    <string>2.9.6</string>
+    <string>@VERSION@</string>
     <key>CFBundleSignature</key>
     <string>????</string>
     <key>CFBundleVersion</key>
-    <string>2.9.6</string>
+    <string>@VERSION@</string>
     <key>NSHumanReadableCopyright</key>
     <string></string>
     <key>LSMinimumSystemVersion</key>
diff --git a/osx/hexchat.bundle b/osx/hexchat.bundle
index 0ed14b6c..58baac57 100644
--- a/osx/hexchat.bundle
+++ b/osx/hexchat.bundle
@@ -15,7 +15,7 @@
   <main-binary>
     ${prefix}/bin/hexchat
   </main-binary>
-<!--
+
   <binary>
     ${prefix}/lib/hexchat/plugins/*.so
   </binary>
@@ -29,7 +29,9 @@
   <data>
     ${prefix}/lib/python2.7/
   </data>
--->
+  <data>
+    ${prefix}/include/python2.7/pyconfig.h
+  </data>
 
   <binary>
     ${prefix}/lib/${gtkdir}/modules/*.so
diff --git a/osx/launcher.sh b/osx/launcher.sh
index 19915b4a..61fb0276 100755
--- a/osx/launcher.sh
+++ b/osx/launcher.sh
@@ -35,9 +35,11 @@ export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gtk-2.0/gdk-pixbuf.loaders"
 export PANGO_LIBDIR="$bundle_lib"
 export PANGO_SYSCONFDIR="$bundle_etc"
 
-#export PYTHON="$bundle_contents/MacOS/python"
-#export PYTHONHOME="$bundle_res"
-#export PYTHONPATH="$bundle_lib/python2.7:$bundle_lib/python2.7/site-packages"
+export PYTHON="$bundle_contents/MacOS/python"
+export PYTHONHOME="$bundle_res"
+export PYTHONPATH="$bundle_lib/python2.7:$bundle_lib/python2.7/site-packages"
+
+export HEXCHAT_LIBDIR="$bundle_lib/hexchat/plugins"
 
 APP=name
 I18NDIR="$bundle_data/locale"
diff --git a/osx/makebundle.sh b/osx/makebundle.sh
index 24130aa1..3a23ee70 100755
--- a/osx/makebundle.sh
+++ b/osx/makebundle.sh
@@ -13,3 +13,7 @@ fi
 rm -rf HexChat.app
 
 $JHBUILD_PREFIX/bin/python $HOME/.local/bin/gtk-mac-bundler hexchat.bundle
+
+# These take up a lot of space in the bundle
+echo "Cleaning up python files"
+find ./HexChat.app/Contents/Resources/lib/python2.7 -name "*.pyo" -or -name "*.pyc" -delete
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 99a43515..0b7dcc77 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,8 +1,3 @@
-# temp. solution while mailcheck & xdcc arn't in SUBDIRS
-EXTRA_DIST = Make.plugin plugin-conf.in xdcc/xdcc.c xdcc/Makefile.am
-
-# noinst_HEADERS = hexchat-plugin.h
-
 if DO_PYTHON
 pythondir = python
 endif
@@ -27,5 +22,4 @@ if DO_SYSINFO
 sysinfodir = sysinfo
 endif
 
-#SUBDIRS = . $(pythondir) $(perldir) mailcheck xdcc
-SUBDIRS = . $(pythondir) $(perldir) $(checksumdir) $(doatdir) $(fishlimdir) $(sysinfodir)
+SUBDIRS = $(pythondir) $(perldir) $(checksumdir) $(doatdir) $(fishlimdir) $(sysinfodir)
diff --git a/plugins/checksum/checksum.c b/plugins/checksum/checksum.c
index a4cadc19..6ace8543 100644
--- a/plugins/checksum/checksum.c
+++ b/plugins/checksum/checksum.c
@@ -20,6 +20,11 @@
  * THE SOFTWARE.
  */
 
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/plugins/fishlim/fish.c b/plugins/fishlim/fish.c
index d4f7b118..1d2d1ce7 100644
--- a/plugins/fishlim/fish.c
+++ b/plugins/fishlim/fish.c
@@ -22,6 +22,11 @@
 
 */
 
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <openssl/blowfish.h>
diff --git a/src/common/Makefile.am b/src/common/Makefile.am
index ca1eaba3..9c2d443e 100644
--- a/src/common/Makefile.am
+++ b/src/common/Makefile.am
@@ -44,6 +44,10 @@ if USE_OPENSSL
 ssl_c = ssl.c
 endif
 
+if USE_MSPROXY
+msproxy_c = msproxy.c
+endif
+
 if USE_DBUS
 dbusdir = dbus
 libhexchatcommon_a_LIBADD =				\
@@ -58,7 +62,7 @@ endif
 noinst_PROGRAMS = make-te
 
 libhexchatcommon_a_SOURCES = cfgfiles.c chanopt.c ctcp.c dcc.c hexchat.c \
-	history.c ignore.c inbound.c modes.c msproxy.c network.c notify.c \
+	history.c ignore.c inbound.c modes.c $(msproxy_c) network.c notify.c \
 	outbound.c plugin.c plugin-timer.c proto-irc.c server.c servlist.c \
 	$(ssl_c) text.c tree.c url.c userlist.c util.c
 libhexchatcommon_a_CFLAGS = $(LIBPROXY_CFLAGS)
diff --git a/src/common/cfgfiles.c b/src/common/cfgfiles.c
index 489eeda2..b7a8beda 100644
--- a/src/common/cfgfiles.c
+++ b/src/common/cfgfiles.c
@@ -926,7 +926,7 @@ make_config_dirs (void)
 {
 	char *buf;
 
-	if (g_mkdir (get_xdir (), 0700) != 0)
+	if (g_mkdir_with_parents (get_xdir (), 0700) != 0)
 		return -1;
 	
 	buf = g_build_filename (get_xdir (), "addons", NULL);
diff --git a/src/common/hexchat.h b/src/common/hexchat.h
index 39a44191..7143f8ab 100644
--- a/src/common/hexchat.h
+++ b/src/common/hexchat.h
@@ -31,6 +31,13 @@
 #ifndef HEXCHAT_H
 #define HEXCHAT_H
 
+#ifdef USE_OPENSSL
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+#endif
+
 #include "history.h"
 
 #ifndef HAVE_SNPRINTF
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 286a68c7..89ebd89c 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -479,36 +479,50 @@ plugin_auto_load_cb (char *filename)
 	}
 }
 
+static char *
+plugin_get_libdir ()
+{
+	const char *libdir;
+
+	libdir = g_getenv ("HEXCHAT_LIBDIR");
+	if (libdir && *libdir)
+		return (char*)libdir;
+	else
+		return HEXCHATLIBDIR;
+}
+
 void
 plugin_auto_load (session *sess)
 {
+	char *lib_dir; 
 	char *sub_dir;
 	ps = sess;
 
+	lib_dir = plugin_get_libdir ();
 	sub_dir = g_build_filename (get_xdir (), "addons", NULL);
 
 #ifdef WIN32
 	/* a long list of bundled plugins that should be loaded automatically,
 	 * user plugins should go to <config>, leave Program Files alone! */
-	for_files (HEXCHATLIBDIR, "hcchecksum.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcdoat.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcexec.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcfishlim.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcmpcinfo.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcperl.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcpython2.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcpython3.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcupd.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcwinamp.dll", plugin_auto_load_cb);
-	for_files (HEXCHATLIBDIR, "hcsysinfo.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcchecksum.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcdoat.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcexec.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcfishlim.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcmpcinfo.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcpython2.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcwinamp.dll", plugin_auto_load_cb);
+	for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb);
 
 	for_files (sub_dir, "*.dll", plugin_auto_load_cb);
 #else
 #if defined(__hpux)
-	for_files (HEXCHATLIBDIR, "*.sl", plugin_auto_load_cb);
+	for_files (lib_dir, "*.sl", plugin_auto_load_cb);
 	for_files (sub_dir, "*.sl", plugin_auto_load_cb);
 #else
-	for_files (HEXCHATLIBDIR, "*.so", plugin_auto_load_cb);
+	for_files (lib_dir, "*.so", plugin_auto_load_cb);
 	for_files (sub_dir, "*.so", plugin_auto_load_cb);
 #endif
 #endif
@@ -1166,7 +1180,7 @@ hexchat_get_info (hexchat_plugin *ph, const char *id)
 	switch (hash)
 	{
 		case 0x325acab5:	/* libdirfs */
-			return HEXCHATLIBDIR;
+			return plugin_get_libdir ();
 
 		case 0x14f51cd8: /* version */
 			return PACKAGE_VERSION;
diff --git a/src/common/servlist.c b/src/common/servlist.c
index 46f99c5d..c84df64c 100644
--- a/src/common/servlist.c
+++ b/src/common/servlist.c
@@ -120,6 +120,12 @@ static const struct defaultserver def[] =
 	{"Beirut", 0},
 	{0,			"irc.beirut.com"},
 
+	{"Canternet", 0, 0, 0, LOGIN_SASL},
+#ifdef USE_OPENSSL
+	{0, 		"irc.canternet.org/+6697"},
+#endif
+	{0,			"irc.canternet.org"},
+
 	{"Chat4all", 0},
 #ifdef USE_OPENSSL
 	{0,			"irc.chat4all.org/+7001"},
@@ -463,6 +469,12 @@ static const struct defaultserver def[] =
 #endif
 	{0,			"irc.swiftirc.net/6667"},
 
+	{"synIRC", 0},
+#ifdef USE_OPENSSL
+	{0, "irc.synirc.net/+6697"},
+#endif
+	{0, "irc.synirc.net/6667"},
+
 	{"Techman's World IRC",		0},
 #ifdef USE_OPENSSL
 	{0,			"irc.techmansworld.com/+6697"},
diff --git a/src/common/ssl.c b/src/common/ssl.c
index 742da619..d036fb66 100644
--- a/src/common/ssl.c
+++ b/src/common/ssl.c
@@ -17,6 +17,11 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#ifdef __APPLE__
+#define __AVAILABILITYMACROS__
+#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER
+#endif
+
 #include "inet.h"				  /* make it first to avoid macro redefinitions */
 #include <openssl/ssl.h>		  /* SSL_() */
 #include <openssl/err.h>		  /* ERR_() */
diff --git a/src/fe-gtk/Makefile.am b/src/fe-gtk/Makefile.am
index 2e95232e..5a622fa0 100644
--- a/src/fe-gtk/Makefile.am
+++ b/src/fe-gtk/Makefile.am
@@ -14,6 +14,10 @@ EXTRA_DIST = \
 	sexy-spell-entry.h sexy-marshal.h textgui.h urlgrab.h userlistgui.h xtext.h \
 	../../data/hexchat.gresource.xml
 
+BUILT_SOURCES = resources.c
+
+CLEANFILES = $(BUILT_SOURCES)
+
 if DO_PLUGIN
 plugingui_c = plugingui.c
 endif
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 7a9ee8a1..389607d0 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -944,6 +944,7 @@ static int
 servlist_savegui (void)
 {
 	char *sp;
+	const char *nick1, *nick2;
 
 	/* check for blank username, ircd will not allow this */
 	if (gtk_entry_get_text (GTK_ENTRY (entry_guser))[0] == 0)
@@ -952,8 +953,15 @@ servlist_savegui (void)
 	/* if (gtk_entry_get_text (GTK_ENTRY (entry_greal))[0] == 0)
 		return 1; */
 
-	strcpy (prefs.hex_irc_nick1, gtk_entry_get_text (GTK_ENTRY (entry_nick1)));
-	strcpy (prefs.hex_irc_nick2, gtk_entry_get_text (GTK_ENTRY (entry_nick2)));
+	nick1 = gtk_entry_get_text (GTK_ENTRY (entry_nick1));
+	nick2 = gtk_entry_get_text (GTK_ENTRY (entry_nick2));
+
+	/* ensure unique nicknames */
+	if (!rfc_casecmp (nick1, nick2))
+		return 2;
+
+	strcpy (prefs.hex_irc_nick1, nick1);
+	strcpy (prefs.hex_irc_nick2, nick2);
 	strcpy (prefs.hex_irc_nick3, gtk_entry_get_text (GTK_ENTRY (entry_nick3)));
 	strcpy (prefs.hex_irc_user_name, gtk_entry_get_text (GTK_ENTRY (entry_guser)));
 	sp = strchr (prefs.hex_irc_user_name, ' ');
@@ -1104,12 +1112,20 @@ servlist_toggle_global_user (gboolean sensitive)
 static void
 servlist_connect_cb (GtkWidget *button, gpointer userdata)
 {
+	int servlist_err;
+
 	if (!selected_net)
 		return;
 
-	if (servlist_savegui () != 0)
+	servlist_err = servlist_savegui ();
+	if (servlist_err == 1)
+	{
+		fe_message (_("User name cannot be left blank."), FE_MSG_ERROR);
+		return;
+	}
+	else if (servlist_err == 2)
 	{
-		fe_message (_("User name and Real name cannot be left blank."), FE_MSG_ERROR);
+		fe_message (_("You must have a unique nickname for Second Choice."), FE_MSG_ERROR);
 		return;
 	}
 
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 7010ac46..52751b69 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -857,7 +857,10 @@ gtk_xtext_find_x (GtkXText * xtext, int x, textentry * ent, int subline,
 		indent = xtext->buffer->indent;
 
 	if (line > xtext->adj->page_size || line < 0)
+	{
+		*out_of_bounds = TRUE;
 		return 0;
+	}
 
 	if (xtext->buffer->grid_dirty || line > 255)
 	{
@@ -890,6 +893,10 @@ gtk_xtext_find_char (GtkXText * xtext, int x, int y, int *off,
 	int line;
 	int subline;
 
+	/* Adjust y value for negative rounding, double to int */
+	if (y < 0)
+		y -= xtext->fontsize;
+
 	line = (y + xtext->pixel_offset) / xtext->fontsize;
 	ent = gtk_xtext_nth (xtext, line + (int)xtext->adj->value, &subline);
 	if (!ent)
@@ -1270,6 +1277,9 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 			gtk_xtext_render_page (xtext);
 		return;
 	}
+	else if (tmp) {
+		offset_start = xtext->buffer->last_offset_start;
+	}
 
 	ent_end = gtk_xtext_find_char (xtext, high_x, high_y, &offset_end, &tmp);
 	if (!ent_end)
@@ -1283,6 +1293,10 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 		}
 		offset_end = ent_end->str_len;
 	}
+	else if (tmp)
+	{
+		offset_end = xtext->buffer->last_offset_end;
+	}
 
 	/* marking less than a complete line? */
 	/* make sure "start" is smaller than "end" (swap them if need be) */
@@ -1317,6 +1331,11 @@ gtk_xtext_selection_draw (GtkXText * xtext, GdkEventMotion * event, gboolean ren
 			ent = ent->next;
 		}
 	}
+	else
+	{
+		if (xtext->mark_stamp)
+			offset_start = 0;
+	}
 
 	if (render)
 		gtk_xtext_selection_render (xtext, ent_start, offset_start, ent_end, offset_end);
@@ -1351,7 +1370,6 @@ gtk_xtext_scrolldown_timeout (GtkXText * xtext)
 		return 0;
 	}
 
-	adj->value = (int)adj->value;	/* Align to line boundary */
 	xtext->select_start_y -= xtext->fontsize;
 	xtext->select_start_adj++;
 	adj->value++;
@@ -1372,6 +1390,7 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext)
 	int p_y;
 	xtext_buffer *buf = xtext->buffer;
 	GtkAdjustment *adj = xtext->adj;
+	int delta_y;
 
 	gdk_window_get_pointer (GTK_WIDGET (xtext)->window, 0, &p_y, 0);
 
@@ -1384,10 +1403,16 @@ gtk_xtext_scrollup_timeout (GtkXText * xtext)
 		return 0;
 	}
 
-	adj->value = (int)adj->value;	/* Align to line boundary */
-	xtext->select_start_y += xtext->fontsize;
-	xtext->select_start_adj--;
-	adj->value--;
+	if (adj->value < 0)
+	{
+		delta_y = adj->value * xtext->fontsize;
+		adj->value = 0;
+	} else {
+		delta_y = xtext->fontsize;
+		adj->value--;
+	}
+	xtext->select_start_y += delta_y;
+	xtext->select_start_adj = adj->value;
 	gtk_adjustment_value_changed (adj);
 	gtk_xtext_selection_draw (xtext, NULL, TRUE);
 	gtk_xtext_render_ents (xtext, buf->pagetop_ent->prev, buf->last_ent_end);
@@ -1793,10 +1818,9 @@ gtk_xtext_unselect (GtkXText *xtext)
 	gtk_xtext_selection_clear (xtext->buffer);
 
 	/* FIXME: use jump_out on multi-line selects too! */
-	gtk_xtext_render_ents (xtext, buf->last_ent_start, buf->last_ent_end);
-
 	xtext->jump_in_offset = 0;
 	xtext->jump_out_offset = 0;
+	gtk_xtext_render_ents (xtext, buf->last_ent_start, buf->last_ent_end);
 
 	xtext->skip_border_fills = FALSE;
 	xtext->skip_stamp = FALSE;
diff --git a/src/htm/Makefile.am b/src/htm/Makefile.am
index 85480402..e524bf27 100644
--- a/src/htm/Makefile.am
+++ b/src/htm/Makefile.am
@@ -1,10 +1,13 @@
-MDTOOL_OPTS = --verbose
-
 theme_SCRIPTS = thememan.exe thememan
 themedir = $(bindir)
 
+mdtool_verbose = $(mdtool_verbose_$(V))
+mdtool_verbose_ = $(mdtool_verbose_$(AM_DEFAULT_VERBOSITY))
+mdtool_verbose_0 = @echo "  MDTOOL  " $@; $(MDTOOL) build $< > /dev/null;
+mdtool_verbose_1 = $(MDTOOL) --verbose build $<;
+
 thememan.exe: htm-mono.csproj
-	$(MDTOOL) $(MDTOOL_OPTS) build $<
+	$(mdtool_verbose)
 
 clean-local:
 	rm -f thememan.exe thememan.exe.config thememan.exe.mdb thememan Main.resources