[gtk+] tests: Produce load without waiting for draw signal
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] tests: Produce load without waiting for draw signal
- Date: Fri, 18 Nov 2016 06:25:15 +0000 (UTC)
commit a57fe52fc622376ab48dfbed72a70bb7e3ed8712
Author: Benjamin Otte <otte redhat com>
Date: Fri Nov 18 07:15:12 2016 +0100
tests: Produce load without waiting for draw signal
tests/testimage.c | 21 ++-------------------
1 files changed, 2 insertions(+), 19 deletions(-)
---
diff --git a/tests/testimage.c b/tests/testimage.c
index b560b8e..522b282 100644
--- a/tests/testimage.c
+++ b/tests/testimage.c
@@ -75,22 +75,6 @@ idle_func (gpointer data)
return G_SOURCE_CONTINUE;
}
-static gboolean
-anim_image_draw (GtkWidget *widget,
- cairo_t *cr,
- gpointer data)
-{
- g_print ("start busyness\n");
-
- g_signal_handlers_disconnect_by_func (widget, anim_image_draw, data);
-
- /* produce high load */
- g_idle_add_full (G_PRIORITY_DEFAULT,
- idle_func, NULL, NULL);
-
- return FALSE;
-}
-
int
main (int argc, char **argv)
{
@@ -178,9 +162,8 @@ main (int argc, char **argv)
gtk_grid_attach (GTK_GRID (grid), image, 2, 6, 1, 1);
/* produce high load */
- g_signal_connect_after (image, "draw",
- G_CALLBACK (anim_image_draw),
- NULL);
+ g_idle_add_full (G_PRIORITY_DEFAULT,
+ idle_func, NULL, NULL);
}
gtk_widget_show_all (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]