From e22e9f5df562bf9986afd960a86453e82869394a Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 31 Mar 2014 22:55:13 -0400 Subject: [PATCH] main: Refactor some code slightly --- src/core/main.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/core/main.c b/src/core/main.c index d4a8ac3f8..4ccf75a07 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -318,19 +318,17 @@ static GSourceFuncs event_funcs = { static void meta_clutter_init (void) { + GSource *source; + clutter_x11_set_display (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ())); clutter_x11_disable_event_retrieval (); - if (CLUTTER_INIT_SUCCESS == clutter_init (NULL, NULL)) - { - GSource *source = g_source_new (&event_funcs, sizeof (GSource)); - g_source_attach (source, NULL); - g_source_unref (source); - } - else - { - meta_fatal ("Unable to initialize Clutter.\n"); - } + if (clutter_init (NULL, NULL) != CLUTTER_INIT_SUCCESS) + meta_fatal ("Unable to initialize Clutter.\n"); + + source = g_source_new (&event_funcs, sizeof (GSource)); + g_source_attach (source, NULL); + g_source_unref (source); } /**