[mutter/wip/wayland] wayland: Tweak wayland source priority for robustness



commit 42ecd26fff9ee1de88d6194bc855782a8defc262
Author: Robert Bragg <robert linux intel com>
Date:   Wed Jan 18 19:25:54 2012 +0000

    wayland: Tweak wayland source priority for robustness
    
    It's currently rather awkward to deal with the fact that we have two
    unsynchronized command streams between xwayland and the compositor (a
    regular X client connection + a wayland protocol connection) and it's
    difficult to know how to handle some wayland events without knowing
    what (in X terms) caused them.
    
    As an initial attempt to improve robustness this patch tweaks the
    priority of the x wayland event source to be slightly lower than the x
    event source to improve the chance that we learn about x client events
    in X terms before getting further events in wayland terms.
    
    Longer term we possibly want to investigate proxying the X protocol
    over the wayland protocol so that the two command streams become
    implicitly synchronized.

 src/wayland/meta-wayland.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index 5eedb82..c0f995a 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1194,6 +1194,15 @@ meta_wayland_init (void)
     wl_display_get_event_loop (compositor->wayland_display);
   compositor->wayland_event_source =
     wayland_event_source_new (compositor->wayland_loop);
+  /* XXX: HACK: Here we are setting the wayland even source to have a slightly
+   * lower priority than the X event source, because we are much more likely to
+   * get confused being told about surface changes relating to X clients when
+   * we don't know what's happened to them according to the X protocol.
+   *
+   * At some point we should probably try and get the X protocol proxied over
+   * the wayland protocol so that we don't have to worry about synchronizing
+   * the two command streams. */
+  g_source_set_priority (compositor->wayland_event_source, 151);
   g_source_attach (compositor->wayland_event_source, NULL);
 
   clutter_wayland_set_compositor_display (compositor->wayland_display);



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