[Spice-commits] client/display_channel.cpp

Alexander Larsson alexl at kemper.freedesktop.org
Wed Jun 23 02:38:30 PDT 2010


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

New commits:
commit f35ac2049a84fd5edbea43f679dfcd3cd4173367
Author: Alexander Larsson <alexl at redhat.com>
Date:   Wed Jun 23 11:37:01 2010 +0200

    Fix screen resolution changes on old servers
    
    * Correctly check for existing canvas 0
    * Don't try to unlock the screen size if there is no active screen

diff --git a/client/display_channel.cpp b/client/display_channel.cpp
index 736e9fb..5469653 100644
--- a/client/display_channel.cpp
+++ b/client/display_channel.cpp
@@ -1200,7 +1200,7 @@ void DisplayChannel::handle_mode(RedPeer::InMessage* message)
 {
     SpiceMsgDisplayMode *mode = (SpiceMsgDisplayMode *)message->data();
 
-    if (screen()) {
+    if (surfaces_mngr.is_present_canvas(0)) {
         destroy_primary_surface();
     }
     create_primary_surface(mode->x_res, mode->y_res,
@@ -1451,8 +1451,8 @@ void DisplayChannel::create_surface(int surface_id, int width, int height, uint3
 
 void DisplayChannel::destroy_primary_surface()
 {
-#ifdef USE_OGL
     if (screen()) {
+#ifdef USE_OGL
         if (surfaces_mngr.is_present_canvas(0)) {
             Canvas *canvas;
 
@@ -1462,11 +1462,11 @@ void DisplayChannel::destroy_primary_surface()
                 screen()->untouch_context();
             }
         }
-    }
 #endif
 
-	AutoRef<UnlockScreenEvent> unlock_event(new UnlockScreenEvent(screen()));
-    get_client().push_event(*unlock_event);
+        AutoRef<UnlockScreenEvent> unlock_event(new UnlockScreenEvent(screen()));
+        get_client().push_event(*unlock_event);
+    }
 
     AutoRef<DestroyPrimarySurfaceEvent> event(new DestroyPrimarySurfaceEvent(*this));
     get_client().push_event(*event);


More information about the Spice-commits mailing list