[Spice-commits] Branch '0.8' - client/display_channel.cpp

Christophe Fergau teuf at kemper.freedesktop.org
Tue Sep 20 07:12:42 PDT 2011

 client/display_channel.cpp |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit b353c8e04f96b28058b7151d5f71d3bca97feb8c
Author: Christophe Fergeau <cfergeau at redhat.com>
Date:   Fri Sep 16 08:56:38 2011 +0200

    client: don't crash when booting a Xinerama setup
    In a Xinerama setup, when X starts up and creates one of the
    secondary screens, first a non-primary surface is created on the
    secondary screen, and then the primary surface for this screen is
    This causes a crash when the guest uses Xinerama and the client
    is attached to the VM before X starts (ie while the guest is
    This happens because DisplayChannel::create_canvas (which is called
    when creating a non-primary surface) assumes a screen has already been
    set for the DisplayChannel while this only happens upon primary surface
    creation. However, it uses the screen for non important stuff, so we
    can test if screen() is non NULL before using it. This is what is done
    in other parts of this file.
    Fixes rhbz #732423

diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 3e43aae..ea0623c 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -1162,13 +1162,15 @@ void DisplayChannel::create_canvas(int surface_id, const std::vector<int>& canva
     unsigned int i;
+    if (screen()) {
 #ifdef USE_OGL
-    if (screen()->need_recreate_context_gl()) {
-        recreate = false;
-    }
+        if (screen()->need_recreate_context_gl()) {
+            recreate = false;
+        }
-    screen()->set_update_interrupt_trigger(NULL);
+        screen()->set_update_interrupt_trigger(NULL);
+    }
     for (i = 0; i < canvas_types.size(); i++) {

More information about the Spice-commits mailing list