[gnome-todo] Adapt to GTK4 API changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] Adapt to GTK4 API changes
- Date: Mon, 17 Feb 2020 17:34:58 +0000 (UTC)
commit c274729d65d159ff64d673706de531d39c6a03eb
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Mon Feb 17 14:17:44 2020 -0300
Adapt to GTK4 API changes
DnD still doesn't work, but this commit at
least makes GNOME To Do buildable.
src/gtd-task-list-panel.c | 17 +---
src/gtd-task-list-panel.ui | 4 +-
src/gtd-utils.c | 3 +-
src/task-list-view/gtd-dnd-row.c | 6 +-
src/task-list-view/gtd-task-list-view.c | 130 ++++++++++++++++++++++---------
src/task-list-view/gtd-task-list-view.ui | 3 -
src/task-list-view/gtd-task-row.c | 109 +++++++++++++-------------
src/task-list-view/gtd-task-row.ui | 7 --
tests/interactive/test-colorbutton.c | 3 +-
tests/interactive/test-filter-sort.c | 3 +-
tests/interactive/test-task-model.c | 3 +-
11 files changed, 166 insertions(+), 122 deletions(-)
---
diff --git a/src/gtd-task-list-panel.c b/src/gtd-task-list-panel.c
index 8d2c132..1590411 100644
--- a/src/gtd-task-list-panel.c
+++ b/src/gtd-task-list-panel.c
@@ -36,7 +36,7 @@ struct _GtdTaskListPanel
{
GtkBox parent;
- GtkModelButton *archive_button;
+ GtkButton *archive_button;
GtkFlowBox *colors_flowbox;
GtkPopover *popover;
GtkWidget *rename_button;
@@ -196,7 +196,7 @@ update_archive_button (GtdTaskListPanel *self)
archived = gtd_task_list_get_archived (list);
g_object_set (self->archive_button,
- "text", archived ? _("Unarchive") : _("Archive"),
+ "label", archived ? _("Unarchive") : _("Archive"),
NULL);
GTD_EXIT;
@@ -208,7 +208,7 @@ update_archive_button (GtdTaskListPanel *self)
*/
static void
-on_archive_button_clicked_cb (GtkModelButton *button,
+on_archive_button_clicked_cb (GtkButton *button,
GtdTaskListPanel *self)
{
GtdProvider *provider;
@@ -265,7 +265,7 @@ on_colors_flowbox_child_activated_cb (GtkFlowBox *colors_flowbox,
}
static void
-on_delete_button_clicked_cb (GtkModelButton *button,
+on_delete_button_clicked_cb (GtkButton *button,
GtdTaskListPanel *self)
{
GtdTaskList *list;
@@ -456,14 +456,6 @@ gtd_panel_iface_init (GtdPanelInterface *iface)
* GObject overrides
*/
-static void
-gtd_task_list_panel_finalize (GObject *object)
-{
- //GtdTaskListPanel *self = (GtdTaskListPanel *)object;
-
- G_OBJECT_CLASS (gtd_task_list_panel_parent_class)->finalize (object);
-}
-
static void
gtd_task_list_panel_get_property (GObject *object,
guint prop_id,
@@ -517,7 +509,6 @@ gtd_task_list_panel_class_init (GtdTaskListPanelClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
- object_class->finalize = gtd_task_list_panel_finalize;
object_class->get_property = gtd_task_list_panel_get_property;
object_class->set_property = gtd_task_list_panel_set_property;
diff --git a/src/gtd-task-list-panel.ui b/src/gtd-task-list-panel.ui
index 7b59118..8359d3b 100644
--- a/src/gtd-task-list-panel.ui
+++ b/src/gtd-task-list-panel.ui
@@ -37,8 +37,8 @@
<object class="GtkSeparator"/>
</child>
<child>
- <object class="GtkModelButton" id="archive_button">
- <property name="text" translatable="yes">Archive</property>
+ <object class="GtkButton" id="archive_button">
+ <property name="label" translatable="yes">Archive</property>
<signal name="clicked" handler="on_archive_button_clicked_cb" object="GtdTaskListPanel"
swapped="no"/>
</object>
</child>
diff --git a/src/gtd-utils.c b/src/gtd-utils.c
index 294355f..3e5646a 100644
--- a/src/gtd-utils.c
+++ b/src/gtd-utils.c
@@ -18,6 +18,7 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
+#include "gtd-task.h"
#include "gtd-utils.h"
#include "gtd-utils-private.h"
@@ -117,7 +118,7 @@ _gtd_get_content_formats (void)
static GdkContentFormats *content_formats = NULL;
if (!content_formats)
- content_formats = gdk_content_formats_new_for_gtype (GTK_TYPE_WIDGET);
+ content_formats = gdk_content_formats_new_for_gtype (GTD_TYPE_TASK);
return content_formats;
}
diff --git a/src/task-list-view/gtd-dnd-row.c b/src/task-list-view/gtd-dnd-row.c
index 1ba983c..474ef08 100644
--- a/src/task-list-view/gtd-dnd-row.c
+++ b/src/task-list-view/gtd-dnd-row.c
@@ -224,6 +224,7 @@ gtd_dnd_row_drag_drop (GtkWidget *widget,
gint x,
gint y)
{
+#if 0
GtdDndRow *self;
GtkWidget *source_widget, *row;
GtdTask *row_task, *target_task;
@@ -283,7 +284,6 @@ gtd_dnd_row_drag_drop (GtkWidget *widget,
gtk_list_box_invalidate_sort (GTK_LIST_BOX (gtk_widget_get_parent (widget)));
- return TRUE;
+#endif
+ return FALSE;
}
-
-
diff --git a/src/task-list-view/gtd-task-list-view.c b/src/task-list-view/gtd-task-list-view.c
index 8b9833a..d074e6b 100644
--- a/src/task-list-view/gtd-task-list-view.c
+++ b/src/task-list-view/gtd-task-list-view.c
@@ -741,28 +741,83 @@ check_dnd_scroll (GtdTaskListView *self,
}
}
+static GtdTask*
+get_task_from_drag (GtdTaskListView *self,
+ GdkDrag *drag)
+{
+ g_autoptr (GdkContentProvider) content = NULL;
+ g_autoptr (GError) error = NULL;
+ GValue value;
+
+ g_object_get (drag, "content", &content, NULL);
+ if (!content)
+ {
+ g_info ("Only dragging task rows is supported");
+ return NULL;
+ }
+
+ g_value_init (&value, GTD_TYPE_TASK);
+ gdk_content_provider_get_value (content, &value, &error);
+ if (!error)
+ {
+ g_warning ("Error retriving drag value: %s", error->message);
+ return NULL;
+ }
+
+ g_assert (G_VALUE_HOLDS_OBJECT (&value));
+
+ g_message ("%p", g_value_get_object (&value));
+ return g_value_get_object (&value);
+}
+
+static gboolean
+on_drop_target_accept_cb (GtkDropTarget *drop_target,
+ GdkDrop *drop,
+ GtdTaskListView *self)
+{
+ g_autoptr (GdkContentFormats) formats = NULL;
+ g_autoptr (GString) string = NULL;
+ GdkContentProvider *provider;
+ GdkDrag *drag;
+
+ GTD_ENTRY;
+
+ drag = gdk_drop_get_drag (drop);
+
+ if (!drag)
+ GTD_RETURN (FALSE);
+
+ provider = gdk_drag_get_con
+ formats = gdk_dr (drop);
+
+ string = g_string_new ("");
+ gdk_content_formats_print (formats, string);
+ g_message ("%s: %s", G_STRFUNC, string->str);
+
+ GTD_RETURN (gdk_content_formats_contain_gtype (formats, GTD_TYPE_TASK));
+}
+
static void
-listbox_drag_leave (GtkListBox *listbox,
- GdkDrop *drop,
- GtdTaskListView *self)
+on_drop_target_drag_leave_cb (GtkDropTarget *drop_target,
+ GdkDrop *drop,
+ GtdTaskListView *self)
{
unset_previously_highlighted_row (self);
check_dnd_scroll (self, TRUE, -1);
}
static gboolean
-listbox_drag_motion (GtkListBox *listbox,
- GdkDrop *drop,
- gint x,
- gint y,
- GtdTaskListView *self)
+on_drop_target_drag_motion_cb (GtkDropTarget *drop_target,
+ GdkDrop *drop,
+ gint x,
+ gint y,
+ GtdTaskListView *self)
{
GtdTaskListViewPrivate *priv;
GtkListBoxRow *highlighted_row;
- GtkListBoxRow *source_row;
GtdTaskRow *highlighted_task_row;
GtdTaskRow *source_task_row;
- GtkWidget *source_widget;
+ GtdTask *task;
GdkDrag *drag;
gint x_offset;
@@ -777,9 +832,9 @@ listbox_drag_motion (GtkListBox *listbox,
GTD_GOTO (fail);
}
- source_widget = gtk_drag_get_source_widget (drag);
- source_row = GTK_LIST_BOX_ROW (gtk_widget_get_ancestor (source_widget, GTK_TYPE_LIST_BOX_ROW));
- source_task_row = task_row_from_row (source_row);
+ task = get_task_from_drag (self, drag);
+
+ source_task_row = g_hash_table_lookup (priv->task_to_row, task);
/* Update the x value according to the current offset */
if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
@@ -799,7 +854,7 @@ listbox_drag_motion (GtkListBox *listbox,
if (row_is_subtask_of (source_task_row, highlighted_task_row))
GTD_GOTO (fail);
- gtk_widget_translate_coordinates (GTK_WIDGET (listbox),
+ gtk_widget_translate_coordinates (GTK_WIDGET (priv->listbox),
GTK_WIDGET (highlighted_task_row),
x,
0,
@@ -820,16 +875,15 @@ fail:
}
static gboolean
-listbox_drag_drop (GtkWidget *widget,
- GdkDrop *drop,
- gint x,
- gint y,
- GtdTaskListView *self)
+on_drop_target_drag_drop_cb (GtkDropTarget *drop_target,
+ GdkDrop *drop,
+ gint x,
+ gint y,
+ GtdTaskListView *self)
{
- GtdTaskListViewPrivate *priv = gtd_task_list_view_get_instance_private (self);
+ GtdTaskListViewPrivate *priv;
GtkListBoxRow *drop_row;
GtdTaskRow *hovered_row;
- GtkWidget *source_widget;
GtkWidget *row;
GtdTask *new_parent_task;
GtdTask *hovered_task;
@@ -840,29 +894,30 @@ listbox_drag_drop (GtkWidget *widget,
GTD_ENTRY;
+ priv = gtd_task_list_view_get_instance_private (self);
drag = gdk_drop_get_drag (drop);
- source_widget = gtk_drag_get_source_widget (drag);
-
- unset_previously_highlighted_row (self);
- if (!source_widget)
+ if (!drag)
{
- gdk_drop_finish (drop, 0);
+ g_info ("Only dragging task rows is supported");
GTD_RETURN (FALSE);
}
+ unset_previously_highlighted_row (self);
+
+ source_task = get_task_from_drag (self, drag);
+
/*
* When the drag operation began, the source row was hidden. Now is the time
* to show it again.
*/
- row = gtk_widget_get_ancestor (source_widget, GTD_TYPE_TASK_ROW);
+ row = g_hash_table_lookup (priv->task_to_row, source_task);
gtk_widget_show (row);
drop_row = get_drop_row_at_y (self, y);
hovered_row = task_row_from_row (drop_row);
hovered_task = gtd_task_row_get_task (hovered_row);
new_parent_task = gtd_task_row_get_dnd_drop_task (hovered_row);
- source_task = gtd_task_row_get_task (GTD_TASK_ROW (row));
g_assert (source_task != NULL);
g_assert (source_task != new_parent_task);
@@ -1135,9 +1190,6 @@ gtd_task_list_view_class_init (GtdTaskListViewClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, GtdTaskListView, scrolled_window);
gtk_widget_class_bind_template_child_private (widget_class, GtdTaskListView, stack);
- gtk_widget_class_bind_template_callback (widget_class, listbox_drag_drop);
- gtk_widget_class_bind_template_callback (widget_class, listbox_drag_leave);
- gtk_widget_class_bind_template_callback (widget_class, listbox_drag_motion);
gtk_widget_class_bind_template_callback (widget_class, on_listbox_row_activated_cb);
gtk_widget_class_bind_template_callback (widget_class, on_new_task_row_entered_cb);
gtk_widget_class_bind_template_callback (widget_class, on_new_task_row_exited_cb);
@@ -1150,7 +1202,10 @@ gtd_task_list_view_class_init (GtdTaskListViewClass *klass)
static void
gtd_task_list_view_init (GtdTaskListView *self)
{
- GtdTaskListViewPrivate *priv = gtd_task_list_view_get_instance_private (self);
+ GtdTaskListViewPrivate *priv;
+ GtkDropTarget *target;
+
+ priv = gtd_task_list_view_get_instance_private (self);
self->priv = priv;
@@ -1163,10 +1218,13 @@ gtd_task_list_view_init (GtdTaskListView *self)
gtk_widget_init_template (GTK_WIDGET (self));
- gtk_drag_dest_set (GTK_WIDGET (priv->listbox),
- 0,
- _gtd_get_content_formats (),
- GDK_ACTION_MOVE);
+ target = gtk_drop_target_new (_gtd_get_content_formats (), GDK_ACTION_MOVE);
+ g_signal_connect (target, "accept", G_CALLBACK (on_drop_target_accept_cb), self);
+ g_signal_connect (target, "drag-drop", G_CALLBACK (on_drop_target_drag_drop_cb), self);
+ g_signal_connect (target, "drag-leave", G_CALLBACK (on_drop_target_drag_leave_cb), self);
+ g_signal_connect (target, "drag-motion", G_CALLBACK (on_drop_target_drag_motion_cb), self);
+
+ gtk_widget_add_controller (GTK_WIDGET (priv->listbox), GTK_EVENT_CONTROLLER (target));
priv->renderer = gtd_markdown_renderer_new ();
}
diff --git a/src/task-list-view/gtd-task-list-view.ui b/src/task-list-view/gtd-task-list-view.ui
index 1168a49..2828800 100644
--- a/src/task-list-view/gtd-task-list-view.ui
+++ b/src/task-list-view/gtd-task-list-view.ui
@@ -30,9 +30,6 @@
<object class="GtkListBox" id="listbox">
<property name="hexpand">1</property>
<property name="selection_mode">none</property>
- <signal name="drag-drop" handler="listbox_drag_drop" object="GtdTaskListView"
swapped="no"/>
- <signal name="drag-leave" handler="listbox_drag_leave" object="GtdTaskListView"
swapped="no"/>
- <signal name="drag-motion" handler="listbox_drag_motion" object="GtdTaskListView"
swapped="no"/>
<signal name="row-activated" handler="on_listbox_row_activated_cb"
object="GtdTaskListView" swapped="no"/>
<style>
<class name="transparent"/>
diff --git a/src/task-list-view/gtd-task-row.c b/src/task-list-view/gtd-task-row.c
index 54c48b5..86099fd 100644
--- a/src/task-list-view/gtd-task-row.c
+++ b/src/task-list-view/gtd-task-row.c
@@ -292,13 +292,33 @@ on_button_press_event_cb (GtkGestureClick *gesture,
real_y);
}
+static GdkContentProvider*
+on_drag_prepare_cb (GtkDragSource *source,
+ gdouble x,
+ gdouble y,
+ GtdTaskRow *self)
+{
+ GdkContentProvider *content;
+ GValue value = G_VALUE_INIT;
+
+ GTD_ENTRY;
+
+ /* Setup the content provider */
+ g_value_init (&value, GTD_TYPE_TASK);
+ g_value_set_object (&value, self->task);
+
+ content = gdk_content_provider_new_for_value (&value);
+ g_value_unset (&value);
+
+ GTD_RETURN (content);
+}
+
static void
-on_drag_begin_cb (GtkWidget *event_box,
- GdkDrag *drag,
- GtdTaskRow *self)
+on_drag_begin_cb (GtkDragSource *source,
+ GdkDrag *drag,
+ GtdTaskRow *self)
{
- GtkWidget *widget, *new_row;
- gint x_offset;
+ GtkWidget *widget;
GTD_ENTRY;
@@ -306,18 +326,22 @@ on_drag_begin_cb (GtkWidget *event_box,
gtk_widget_set_cursor_from_name (widget, "grabbing");
+#if 0
+ g_autoptr (GtkWidget) drag_icon = NULL;
+ GtkWidget * *new_row;
+ gint x_offset;
+
/*
* gtk_drag_set_icon_widget() inserts the row in a different GtkWindow, so
* we have to create a new, transient row.
*/
new_row = create_transient_row (self);
+ drag_icon = gtk_drag_icon_new_for_drag (drag);
+ gtk_container_add (GTK_CONTAINER (drag_icon), new_row);
x_offset = gtk_widget_get_margin_start (self->content_box);
-
- gtk_drag_set_icon_widget (drag,
- new_row,
- self->clicked_x + x_offset,
- self->clicked_y);
+ gdk_drag_set_hotspot (drag, self->clicked_x + x_offset, self->clicked_y);
+#endif
gtk_widget_hide (widget);
@@ -325,18 +349,10 @@ on_drag_begin_cb (GtkWidget *event_box,
}
static void
-on_drag_data_get_cb (GtkWidget *widget,
- GdkDrag *drag,
- GtkSelectionData *data,
- GtdTaskRow *self)
-{
- GTD_TRACE_MSG ("Drag data get");
-}
-
-static void
-on_drag_end_cb (GtkWidget *event_box,
- GdkDrag *drag,
- GtdTaskRow *self)
+on_drag_end_cb (GtkDragSource *source,
+ GdkDrag *drag,
+ gboolean delete_data,
+ GtdTaskRow *self)
{
GTD_ENTRY;
@@ -349,10 +365,10 @@ on_drag_end_cb (GtkWidget *event_box,
}
static gboolean
-on_drag_failed_cb (GtkWidget *widget,
- GdkDrag *drag,
- GtkDragResult result,
- GtdTaskRow *self)
+on_drag_cancelled_cb (GtkDragSource *source,
+ GdkDrag *drag,
+ GdkDragCancelReason result,
+ GtdTaskRow *self)
{
GTD_ENTRY;
@@ -573,7 +589,7 @@ gtd_task_row_class_init (GtdTaskRowClass *klass)
"Renderer",
"Renderer",
GTD_TYPE_MARKDOWN_RENDERER,
- G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_PRIVATE |
G_PARAM_STATIC_STRINGS));
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
/**
* GtdTaskRow::task:
@@ -650,10 +666,6 @@ gtd_task_row_class_init (GtdTaskRowClass *klass)
gtk_widget_class_bind_template_callback (widget_class, on_button_press_event_cb);
gtk_widget_class_bind_template_callback (widget_class, on_complete_check_toggled_cb);
- gtk_widget_class_bind_template_callback (widget_class, on_drag_begin_cb);
- gtk_widget_class_bind_template_callback (widget_class, on_drag_data_get_cb);
- gtk_widget_class_bind_template_callback (widget_class, on_drag_end_cb);
- gtk_widget_class_bind_template_callback (widget_class, on_drag_failed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_key_pressed_cb);
gtk_widget_class_bind_template_callback (widget_class, on_remove_task_cb);
gtk_widget_class_bind_template_callback (widget_class, on_task_changed_cb);
@@ -664,25 +676,24 @@ gtd_task_row_class_init (GtdTaskRowClass *klass)
static void
gtd_task_row_init (GtdTaskRow *self)
{
+ GtkDragSource *drag_source;
+
self->handle_subtasks = TRUE;
self->active = FALSE;
gtk_widget_init_template (GTK_WIDGET (self));
- /* DnD icon */
- gtk_drag_source_set (self->dnd_icon,
- GDK_BUTTON1_MASK,
- _gtd_get_content_formats (),
- GDK_ACTION_MOVE);
+ drag_source = gtk_drag_source_new ();
+ gtk_drag_source_set_actions (drag_source, GDK_ACTION_MOVE);
- gtk_widget_set_cursor_from_name (self->dnd_icon, "grab");
+ g_signal_connect (drag_source, "prepare", G_CALLBACK (on_drag_prepare_cb), self);
+ g_signal_connect (drag_source, "drag-begin", G_CALLBACK (on_drag_begin_cb), self);
+ g_signal_connect (drag_source, "drag-cancel", G_CALLBACK (on_drag_cancelled_cb), self);
+ g_signal_connect (drag_source, "drag-end", G_CALLBACK (on_drag_end_cb), self);
- /* Header box */
- gtk_drag_source_set (self->header_event_box,
- GDK_BUTTON1_MASK,
- _gtd_get_content_formats (),
- GDK_ACTION_MOVE);
+ gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drag_source));
+ gtk_widget_set_cursor_from_name (self->dnd_icon, "grab");
gtk_widget_set_cursor_from_name (self->header_event_box, "pointer");
}
@@ -782,18 +793,6 @@ gtd_task_row_set_handle_subtasks (GtdTaskRow *self,
gtk_widget_set_visible (self->dnd_icon, handle_subtasks);
on_depth_changed_cb (self, NULL, self->task);
- if (handle_subtasks)
- {
- gtk_drag_source_set (self->header_event_box,
- GDK_BUTTON1_MASK,
- _gtd_get_content_formats (),
- GDK_ACTION_MOVE);
- }
- else
- {
- gtk_drag_source_unset (self->header_event_box);
- }
-
g_object_notify (G_OBJECT (self), "handle-subtasks");
}
@@ -884,6 +883,7 @@ gtd_task_row_set_drag_offset (GtdTaskRow *self,
GdkDrag *drag,
gint x_offset)
{
+#if 0
GtkWidget *source_widget;
GtkWidget *source_row;
gint current_task_depth;
@@ -908,6 +908,7 @@ gtd_task_row_set_drag_offset (GtdTaskRow *self,
depth);
gtk_widget_show (self->dnd_frame);
+#endif
}
void
diff --git a/src/task-list-view/gtd-task-row.ui b/src/task-list-view/gtd-task-row.ui
index a0b0d09..b8fd25a 100644
--- a/src/task-list-view/gtd-task-row.ui
+++ b/src/task-list-view/gtd-task-row.ui
@@ -30,10 +30,6 @@
<object class="GtkImage" id="dnd_icon">
<property name="icon-name">drag-handle-symbolic</property>
<property name="pixel-size">16</property>
- <signal name="drag-begin" handler="on_drag_begin_cb" object="GtdTaskRow" swapped="no"/>
- <signal name="drag-end" handler="on_drag_end_cb" object="GtdTaskRow" swapped="no"/>
- <signal name="drag-data-get" handler="on_drag_data_get_cb" object="GtdTaskRow"
swapped="no"/>
- <signal name="drag-failed" handler="on_drag_failed_cb" object="GtdTaskRow" swapped="no"/>
<child>
<object class="GtkGestureClick">
<property name="propagation-phase">capture</property>
@@ -57,9 +53,6 @@
</child>
<child>
<object class="GtkBox" id="header_event_box">
- <signal name="drag-begin" handler="on_drag_begin_cb" object="GtdTaskRow" swapped="no"/>
- <signal name="drag-end" handler="on_drag_end_cb" object="GtdTaskRow" swapped="no"/>
- <signal name="drag-failed" handler="on_drag_failed_cb" object="GtdTaskRow" swapped="no"/>
<child>
<object class="GtkGestureClick">
<property name="propagation-phase">capture</property>
diff --git a/tests/interactive/test-colorbutton.c b/tests/interactive/test-colorbutton.c
index 503d2f5..5e8be79 100644
--- a/tests/interactive/test-colorbutton.c
+++ b/tests/interactive/test-colorbutton.c
@@ -82,7 +82,8 @@ main (gint argc,
gtk_container_add (GTK_CONTAINER (window), grid);
gtk_window_present (window);
- gtk_main ();
+ while (TRUE)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}
diff --git a/tests/interactive/test-filter-sort.c b/tests/interactive/test-filter-sort.c
index 2221e2c..849570d 100644
--- a/tests/interactive/test-filter-sort.c
+++ b/tests/interactive/test-filter-sort.c
@@ -283,7 +283,8 @@ main (gint argc,
gtk_container_add (GTK_CONTAINER (window), vbox);
gtk_window_present (window);
- gtk_main ();
+ while (TRUE)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}
diff --git a/tests/interactive/test-task-model.c b/tests/interactive/test-task-model.c
index f68fefc..0f14b48 100644
--- a/tests/interactive/test-task-model.c
+++ b/tests/interactive/test-task-model.c
@@ -164,7 +164,8 @@ main (gint argc,
/* Schedule a live removal of tasks */
dummy_provider_schedule_remove_task (dummy_provider);
- gtk_main ();
+ while (TRUE)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]