[mutter/wip/wayland] meta-wayland: Don't synth x events before x connection



commit 5b984f1d02c4e16647ab92d0f262ba001532f9ad
Author: Robert Bragg <robert linux intel com>
Date:   Fri Jan 13 13:30:50 2012 +0000

    meta-wayland: Don't synth x events before x connection
    
    To avoid race conditions when moving X windows we don't trust motion
    events from X because inaccuracies can creep in due to how they are
    forwarded to xwayland. We currently synthesize x motion events based on
    the clutter events and feed those into mutters X based event handling
    code. This patch ensures we don't synthesize X events before we have
    connected to xwayland since that leads to us dereferencing a NULL
    display pointer.

 src/wayland/meta-wayland.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 9b24b92..2e4fd52 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1035,6 +1035,10 @@ event_cb (ClutterActor *stage,
 
   meta_wayland_input_device_handle_event (compositor->input_device, event);
 
+  display = meta_get_display ();
+  if (!display)
+    return FALSE;
+
   /* We want to synthesize X events for mouse related events so that
      we don't have to rely on the X server's window position being
      synched with the surface positoin. See the comment in
@@ -1074,8 +1078,6 @@ event_cb (ClutterActor *stage,
       return FALSE;
     }
 
-  display = meta_get_display ();
-
   xevent.xany.serial = 0;
   xevent.xany.send_event = False;
   xevent.xany.display = display->xdisplay;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]