diff --git a/gcut-egg-fix-a-bug-that-source-is-removed-twice.patch b/gcut-egg-fix-a-bug-that-source-is-removed-twice.patch new file mode 100644 index 0000000..df911f0 --- /dev/null +++ b/gcut-egg-fix-a-bug-that-source-is-removed-twice.patch @@ -0,0 +1,86 @@ +From 82ecce029a2e7d384b23f44c9c1c14b4ebbcbede Mon Sep 17 00:00:00 2001 +From: Kouhei Sutou +Date: Thu, 15 Jan 2015 21:53:16 +0900 +Subject: [PATCH 3/4] gcut egg: fix a bug that source is removed twice + +Signed-off-by: HAYASHI Kentaro +--- + gcutter/gcut-egg.c | 41 +++++++++++++++++++++++++++++++++++++---- + 1 file changed, 37 insertions(+), 4 deletions(-) + +diff --git a/gcutter/gcut-egg.c b/gcutter/gcut-egg.c +index 83f0ed9..f4f0101 100644 +--- a/gcutter/gcut-egg.c ++++ b/gcutter/gcut-egg.c +@@ -1,6 +1,6 @@ + /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* +- * Copyright (C) 2008-2011 Kouhei Sutou ++ * Copyright (C) 2008-2015 Kouhei Sutou + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by +@@ -650,9 +650,8 @@ read_from_io_channel (GIOChannel *channel, GCutEgg *egg, guint signal) + } + + static gboolean +-watch_output (GIOChannel *source, GIOCondition condition, gpointer user_data) ++watch_common (GIOChannel *source, GIOCondition condition, WatchOutputData *data) + { +- WatchOutputData *data = user_data; + gboolean keep_callback = TRUE; + + if (condition & (G_IO_IN | G_IO_PRI)) { +@@ -678,6 +677,40 @@ watch_output (GIOChannel *source, GIOCondition condition, gpointer user_data) + return keep_callback; + } + ++static gboolean ++watch_output (GIOChannel *source, GIOCondition condition, gpointer user_data) ++{ ++ WatchOutputData *data = user_data; ++ gboolean keep_callback = TRUE; ++ ++ keep_callback = watch_common(source, condition, user_data); ++ ++ if (!keep_callback) { ++ GCutEggPrivate *priv; ++ priv = GCUT_EGG_GET_PRIVATE(data->egg); ++ priv->output_watch_id = 0; ++ } ++ ++ return keep_callback; ++} ++ ++static gboolean ++watch_error (GIOChannel *source, GIOCondition condition, gpointer user_data) ++{ ++ WatchOutputData *data = user_data; ++ gboolean keep_callback = TRUE; ++ ++ keep_callback = watch_common(source, condition, user_data); ++ ++ if (!keep_callback) { ++ GCutEggPrivate *priv; ++ priv = GCUT_EGG_GET_PRIVATE(data->egg); ++ priv->error_watch_id = 0; ++ } ++ ++ return keep_callback; ++} ++ + gboolean + gcut_egg_hatch (GCutEgg *egg, GError **error) + { +@@ -747,7 +780,7 @@ gcut_egg_hatch (GCutEgg *egg, GError **error) + priv->watch_error_data->signal = signals[ERROR_RECEIVED]; + priv->error = create_input_channel(error_fd, + &(priv->error_watch_id), +- watch_output, ++ watch_error, + priv->watch_error_data); + } + +-- +2.1.0 + diff --git a/gcut-egg-fix-a-bug-that-timeout-source-is-removed-twice.patch b/gcut-egg-fix-a-bug-that-timeout-source-is-removed-twice.patch new file mode 100644 index 0000000..fd70a55 --- /dev/null +++ b/gcut-egg-fix-a-bug-that-timeout-source-is-removed-twice.patch @@ -0,0 +1,37 @@ +From dd77d7b6471c12a3654ea3745bf3d639dba1b3ce Mon Sep 17 00:00:00 2001 +From: Kouhei Sutou +Date: Thu, 15 Jan 2015 21:55:02 +0900 +Subject: [PATCH 4/4] gcut egg: fix a bug that timeout source is removed twice + +Signed-off-by: HAYASHI Kentaro +--- + gcutter/gcut-egg.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/gcutter/gcut-egg.c b/gcutter/gcut-egg.c +index f4f0101..ac5c414 100644 +--- a/gcutter/gcut-egg.c ++++ b/gcutter/gcut-egg.c +@@ -342,7 +342,8 @@ dispose (GObject *object) + &is_timeout); + while (!is_timeout && priv->process_watch_id > 0 && priv->pid > 0) + g_main_context_iteration(NULL, TRUE); +- g_source_remove(timeout_wait_id); ++ if (!is_timeout) ++ g_source_remove(timeout_wait_id); + } + } + +@@ -874,7 +875,8 @@ gcut_egg_wait (GCutEgg *egg, guint timeout, GError **error) + timeout_id = g_timeout_add(timeout, cb_timeout_wait, &is_timeout); + while (!is_timeout && priv->pid > 0) + g_main_context_iteration(NULL, TRUE); +- g_source_remove(timeout_id); ++ if (!is_timeout) ++ g_source_remove(timeout_id); + + if (is_timeout) { + gchar *command; +-- +2.1.0 + diff --git a/support-g-key-file-error-quark-2.43-or-later-message.patch b/support-g-key-file-error-quark-2.43-or-later-message.patch new file mode 100644 index 0000000..4325a5e --- /dev/null +++ b/support-g-key-file-error-quark-2.43-or-later-message.patch @@ -0,0 +1,30 @@ +diff --git a/test/gcutter/test-gcut-key-file.c b/test/gcutter/test-gcut-key-file.c +index ddc1125..240369b 100644 +--- a/test/gcutter/test-gcut-key-file.c ++++ b/test/gcutter/test-gcut-key-file.c +@@ -136,7 +136,11 @@ data_get_enum (void) + 0, + g_error_new(G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_KEY_NOT_FOUND, +- "Key file does not have key 'unknown-key'")), ++ "Key file does not have key 'unknown-key'" ++#if GLIB_CHECK_VERSION(2, 43, 0) ++ " in group 'group'" ++#endif ++ )), + enum_test_data_free, + "invalid enum value", + get_enum_test_data_new( +@@ -218,7 +222,11 @@ data_get_flags (void) + 0, + g_error_new(G_KEY_FILE_ERROR, + G_KEY_FILE_ERROR_KEY_NOT_FOUND, +- "Key file does not have key 'unknown-key'")), ++ "Key file does not have key 'unknown-key'" ++#if GLIB_CHECK_VERSION(2, 43, 0) ++ " in group 'group'" ++#endif ++ )), + enum_test_data_free, + "invalid flags value", + get_flags_test_data_new( diff --git a/support-gdk-pixbuf-2.31.0-or-later.patch b/support-gdk-pixbuf-2.31.0-or-later.patch new file mode 100644 index 0000000..94d3055 --- /dev/null +++ b/support-gdk-pixbuf-2.31.0-or-later.patch @@ -0,0 +1,65 @@ +From 1c1c3e696b69b695449f4fa97d9de249cc46e8e8 Mon Sep 17 00:00:00 2001 +From: Kouhei Sutou +Date: Thu, 15 Jan 2015 21:25:50 +0900 +Subject: [PATCH 1/4] test: support gdk-pixbuf 2.31.0 or later + +gdk-pixbuf 2.31.0 introduces pixel-bytes property. + +GitHub: fix #19 + +Reported by mtasaka. Thanks!!! + +Signed-off-by: HAYASHI Kentaro +--- + test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c b/test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c +index 1b94d21..f7c9e8f 100644 +--- a/test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c ++++ b/test/gdkcutter-pixbuf/test-gdkcut-pixbuf.c +@@ -1,6 +1,6 @@ + /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* +- * Copyright (C) 2009-2011 Kouhei Sutou ++ * Copyright (C) 2009-2015 Kouhei Sutou + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by +@@ -23,6 +23,11 @@ + #include + #include "../lib/cuttest-utils.h" + ++#if (GDK_PIXBUF_MAJOR > 2 || \ ++ (GDK_PIXBUF_MAJOR == 2 && GDK_PIXBUF_MINOR >= 31)) ++# define HAVE_PIXEL_BYTES ++#endif ++ + void test_equal_property(void); + void test_equal_content(void); + void test_equal_content_threshold(void); +@@ -136,6 +141,10 @@ test_inspect (void) + "height=<100>, " + "rowstride=<400>, " + "pixels=<((gpointer) %p)>" ++#ifdef HAVE_PIXEL_BYTES ++ ", " ++ "pixel-bytes=" ++#endif + ">", + pixbuf1, + gdk_pixbuf_get_pixels(pixbuf1)); +@@ -152,6 +161,10 @@ test_inspect (void) + "height=<50>, " + "rowstride=<152>, " + "pixels=<((gpointer) %p)>" ++#ifdef HAVE_PIXEL_BYTES ++ ", " ++ "pixel-bytes=" ++#endif + ">", + pixbuf2, + gdk_pixbuf_get_pixels(pixbuf2)); +-- +2.1.0 + diff --git a/test-ensure-dropping-source-ID-when-callback-is-removed.patch b/test-ensure-dropping-source-ID-when-callback-is-removed.patch new file mode 100644 index 0000000..dc35d96 --- /dev/null +++ b/test-ensure-dropping-source-ID-when-callback-is-removed.patch @@ -0,0 +1,42 @@ +From 64367a58c06a218249026a97245716310483b090 Mon Sep 17 00:00:00 2001 +From: Kouhei Sutou +Date: Thu, 15 Jan 2015 21:44:50 +0900 +Subject: [PATCH 2/4] test: ensure dropping source ID when callback is removed + by itself + +Signed-off-by: HAYASHI Kentaro +--- + test/gcutter/test-gcut-string-io-channel.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/test/gcutter/test-gcut-string-io-channel.c b/test/gcutter/test-gcut-string-io-channel.c +index 769fa47..6bd2f23 100644 +--- a/test/gcutter/test-gcut-string-io-channel.c ++++ b/test/gcutter/test-gcut-string-io-channel.c +@@ -1,6 +1,6 @@ + /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + /* +- * Copyright (C) 2008-2011 Kouhei Sutou ++ * Copyright (C) 2008-2015 Kouhei Sutou + * + * This library is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by +@@ -254,6 +254,7 @@ cb_timeout_detect (gpointer user_data) + *timed_out = TRUE; + limit = gcut_string_io_channel_get_buffer_limit(channel); + gcut_string_io_channel_set_buffer_limit(channel, limit + 1); ++ timeout_id = 0; + return FALSE; + } + +@@ -361,6 +362,7 @@ cb_timeout (gpointer data) + + *emitted = TRUE; + gcut_string_io_channel_set_limit(channel, 0); ++ timeout_id = 0; + return FALSE; + } + +-- +2.1.0 +