From 17f48baf3a08b96cb1cb9a4147aa41ee2e0f73cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Tue, 19 Nov 2013 19:44:30 +0100 Subject: [PATCH] display: Tweak code to work around a compiler warning The compiler is not quite smart enough to figure out that the condition for setting the "compositor" variable matches a later condition for accessing it, so express this in a way the compiler will understand. --- src/core/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/display.c b/src/core/display.c index 8e90af094..2a6779d9c 100644 --- a/src/core/display.c +++ b/src/core/display.c @@ -2042,7 +2042,7 @@ meta_display_handle_event (MetaDisplay *display, /* XXX -- we need to fill this in properly at some point... */ gboolean frame_was_receiver = FALSE; #ifdef HAVE_WAYLAND - MetaWaylandCompositor *compositor; + MetaWaylandCompositor *compositor = NULL; if (meta_is_wayland_compositor ()) { @@ -2293,7 +2293,7 @@ meta_display_handle_event (MetaDisplay *display, } #ifdef HAVE_WAYLAND - if (meta_is_wayland_compositor () && (display->grab_op == META_GRAB_OP_NONE)) + if (compositor && (display->grab_op == META_GRAB_OP_NONE)) { if (meta_wayland_compositor_handle_event (compositor, event)) return TRUE;