From ff9af8f0bdecc03a6c434af476f4348ada64b200 Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sun, 27 Nov 2011 22:46:19 -0800 Subject: [PATCH 1/3] Make configure look for txt2tags --- configure.ac | 5 +++++ doc/Makefile.am | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 883c0791..75994632 100644 --- a/configure.ac +++ b/configure.ac @@ -65,6 +65,11 @@ AC_CHECK_PROGS(PYTHON, python, [AC_MSG_ERROR([Python not found])]) MOO_AC_FLAGS +AC_CHECK_PROG([TXT2TAGS], txt2tags, txt2tags) +if test x$MOO_DEV_MODE = "xyes" -a "x$TXT2TAGS" = "x"; then + AC_MSG_ERROR([txt2tags not found]) +fi + AC_CONFIG_HEADERS([config.h]) AH_TOP([#ifndef __CONFIG_H__ #define __CONFIG_H__]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 5f9f5212..dd59884b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -127,7 +127,7 @@ $(srcdir)/built/man-medit.t2t: man-medit.t2t.in $(top_builddir)/config.status $(AM_V_at)mv man-medit.t2t $(srcdir)/built/man-medit.t2t $(srcdir)/built/medit.1: built/man-medit.t2t - $(AM_V_GEN)txt2tags --target=man --outfile=- $(srcdir)/built/man-medit.t2t | grep -v "cmdline: txt2tags" \ + $(AM_V_GEN)$(TXT2TAGS) --target=man --outfile=- $(srcdir)/built/man-medit.t2t | grep -v "cmdline: txt2tags" \ > medit.1.tmp && mv medit.1.tmp $(srcdir)/built/medit.1 endif From 36206c6c132b741b724f033cd1a67b5bf771839d Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sun, 27 Nov 2011 22:47:07 -0800 Subject: [PATCH 2/3] Always show fatal errors on windows --- moo/medit-app/main.c | 9 ++++++ moo/mooutils/mooutils-misc.c | 58 +++++++++++++++++++----------------- 2 files changed, 40 insertions(+), 27 deletions(-) diff --git a/moo/medit-app/main.c b/moo/medit-app/main.c index ceb8f2ff..780694a3 100644 --- a/moo/medit-app/main.c +++ b/moo/medit-app/main.c @@ -648,6 +648,15 @@ medit_main (int argc, char *argv[]) else moo_set_log_func_window (TRUE); } +#ifdef __WIN32__ + else + { + // this will install do-nothing log and print handlers plus + // a fatal error win32 message handler (it will also turn off + // console output, but that is not visible anyway) + moo_set_log_func_silent (); + } +#endif app = MOO_APP (g_object_new (medit_app_get_type (), "run-input", run_input, diff --git a/moo/mooutils/mooutils-misc.c b/moo/mooutils/mooutils-misc.c index 86c211ed..64467d7a 100644 --- a/moo/mooutils/mooutils-misc.c +++ b/moo/mooutils/mooutils-misc.c @@ -786,6 +786,27 @@ moo_reset_log_func (void) * Display log messages in a window */ +#ifdef __WIN32__ +static void +win32_filter_fatal_errors (const gchar *log_domain, + GLogLevelFlags flags, + const gchar *message) +{ + if (flags & (G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)) + { + _moo_win32_show_fatal_error (log_domain, message); + return; + } +} +#else /* __WIN32__ */ +static void +win32_filter_fatal_errors (G_GNUC_UNUSED const gchar *log_domain, + G_GNUC_UNUSED GLogLevelFlags flags, + G_GNUC_UNUSED const gchar *message) +{ +} +#endif /* __WIN32__ */ + #if !defined(__WIN32__) || !defined(DEBUG) static void @@ -811,13 +832,7 @@ log_func_window (const gchar *log_domain, { char *text; -#ifdef __WIN32__ - if (flags & (G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)) - { - _moo_win32_show_fatal_error (log_domain, message); - return; - } -#endif /* __WIN32__ */ + win32_filter_fatal_errors (log_domain, flags, message); if (!g_utf8_validate (message, -1, NULL)) message = ""; @@ -937,26 +952,21 @@ print_func_file (const char *string) static void log_func_file (const char *log_domain, - G_GNUC_UNUSED GLogLevelFlags flags, + GLogLevelFlags flags, const char *message, G_GNUC_UNUSED gpointer dummy) { char *string; -#ifdef __WIN32__ - if (flags & (G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)) - { - _moo_win32_show_fatal_error (log_domain, message); - return; - } -#endif /* __WIN32__ */ - if (log_domain) string = g_strdup_printf ("%s: %s\n", log_domain, message); else string = g_strdup_printf ("%s\n", message); print_func_file (string); + + win32_filter_fatal_errors (log_domain, flags, message); + g_free (string); } @@ -977,18 +987,12 @@ moo_set_log_func_file (const char *log_file) */ static void -log_func_silent (G_GNUC_UNUSED const gchar *log_domain, - G_GNUC_UNUSED GLogLevelFlags flags, - G_GNUC_UNUSED const gchar *message, - G_GNUC_UNUSED gpointer data_unused) +log_func_silent (const gchar *log_domain, + GLogLevelFlags flags, + const gchar *message, + G_GNUC_UNUSED gpointer data_unused) { -#ifdef __WIN32__ - if (flags & (G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION)) - { - _moo_win32_show_fatal_error (log_domain, message); - return; - } -#endif /* __WIN32__ */ + win32_filter_fatal_errors (log_domain, flags, message); } static void From 42d190afce807acf3c61e51cc3bf69706762701a Mon Sep 17 00:00:00 2001 From: Yevgen Muntyan <17531749+muntyan@users.noreply.github.com> Date: Sun, 27 Nov 2011 22:47:48 -0800 Subject: [PATCH 3/3] Attempt to fix crash on windows when color depth is 16 --- .../gtk-win/jhbuildrc/patches/gtk-2.24.patch | 47 ++++++++++++++----- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/plat/win32/gtk-win/jhbuildrc/patches/gtk-2.24.patch b/plat/win32/gtk-win/jhbuildrc/patches/gtk-2.24.patch index 9f8f46b1..ae742e8b 100644 --- a/plat/win32/gtk-win/jhbuildrc/patches/gtk-2.24.patch +++ b/plat/win32/gtk-win/jhbuildrc/patches/gtk-2.24.patch @@ -1,6 +1,6 @@ -diff -r 959ff2e88f4a Makefile.in ---- a/Makefile.in Sat Nov 26 03:37:47 2011 -0800 -+++ b/Makefile.in Sat Nov 26 03:40:41 2011 -0800 +diff -r 7c530856f369 Makefile.in +--- a/Makefile.in Sun Nov 27 22:39:29 2011 -0800 ++++ b/Makefile.in Sun Nov 27 22:44:26 2011 -0800 @@ -457,8 +457,8 @@ || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } \ && DISPLAY=:$$XID && export DISPLAY @@ -12,9 +12,9 @@ diff -r 959ff2e88f4a Makefile.in # require automake 1.4 AUTOMAKE_OPTIONS = 1.7 -diff -r 959ff2e88f4a gdk/Makefile.in ---- a/gdk/Makefile.in Sat Nov 26 03:37:47 2011 -0800 -+++ b/gdk/Makefile.in Sat Nov 26 03:40:41 2011 -0800 +diff -r 7c530856f369 gdk/Makefile.in +--- a/gdk/Makefile.in Sun Nov 27 22:39:29 2011 -0800 ++++ b/gdk/Makefile.in Sun Nov 27 22:44:26 2011 -0800 @@ -516,7 +516,7 @@ --includedir=$(srcdir) \ --includedir=. @@ -24,9 +24,20 @@ diff -r 959ff2e88f4a gdk/Makefile.in DIST_SUBDIRS = win32 x11 quartz directfb tests CLEANFILES = $(am__append_4) INCLUDES = \ -diff -r 959ff2e88f4a gdk/win32/gdkwindow-win32.c ---- a/gdk/win32/gdkwindow-win32.c Sat Nov 26 03:37:47 2011 -0800 -+++ b/gdk/win32/gdkwindow-win32.c Sat Nov 26 03:40:41 2011 -0800 +diff -r 7c530856f369 gdk/win32/gdkpixmap-win32.c +--- a/gdk/win32/gdkpixmap-win32.c Sun Nov 27 22:39:29 2011 -0800 ++++ b/gdk/win32/gdkpixmap-win32.c Sun Nov 27 22:44:26 2011 -0800 +@@ -175,6 +175,7 @@ + format = CAIRO_FORMAT_A8; + break; + ++ case 16: + case 24: + case 32: + format = CAIRO_FORMAT_RGB24; +diff -r 7c530856f369 gdk/win32/gdkwindow-win32.c +--- a/gdk/win32/gdkwindow-win32.c Sun Nov 27 22:39:29 2011 -0800 ++++ b/gdk/win32/gdkwindow-win32.c Sun Nov 27 22:44:26 2011 -0800 @@ -1260,7 +1260,7 @@ { ShowWindow (GDK_WINDOW_HWND (window), SW_SHOWNOACTIVATE); @@ -61,9 +72,9 @@ diff -r 959ff2e88f4a gdk/win32/gdkwindow-win32.c SetFocus (GDK_WINDOW_HWND (window)); } -diff -r 959ff2e88f4a gtk/Makefile.in ---- a/gtk/Makefile.in Sat Nov 26 03:37:47 2011 -0800 -+++ b/gtk/Makefile.in Sat Nov 26 03:40:41 2011 -0800 +diff -r 7c530856f369 gtk/Makefile.in +--- a/gtk/Makefile.in Sun Nov 27 22:39:29 2011 -0800 ++++ b/gtk/Makefile.in Sun Nov 27 22:44:26 2011 -0800 @@ -1230,7 +1230,7 @@ @USE_QUARTZ_FALSE@GTK_PRINT_PREVIEW_COMMAND = "evince --unlink-tempfile --preview --print-settings %s %f" @@ -73,3 +84,15 @@ diff -r 959ff2e88f4a gtk/Makefile.in DIST_SUBDIRS = theme-bits tests @HAVE_CUPS_FALSE@@HAVE_PAPI_CUPS_FALSE@@HAVE_PAPI_FALSE@GTK_PRINT_BACKENDS = file,lpr @HAVE_CUPS_FALSE@@HAVE_PAPI_CUPS_FALSE@@HAVE_PAPI_TRUE@GTK_PRINT_BACKENDS = file,papi +diff -r 7c530856f369 modules/other/gail/Makefile.in +--- a/modules/other/gail/Makefile.in Sun Nov 27 22:39:29 2011 -0800 ++++ b/modules/other/gail/Makefile.in Sun Nov 27 22:44:26 2011 -0800 +@@ -446,7 +446,7 @@ + || { echo "Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests."; exit 1; } \ + && DISPLAY=:$$XID && export DISPLAY + +-SUBDIRS = libgail-util tests ++SUBDIRS = libgail-util + @PLATFORM_WIN32_TRUE@no_undefined = -no-undefined + moduledir = $(libdir)/gtk-2.0/modules + module_LTLIBRARIES = libgail.la