From f35ac2049a84fd5edbea43f679dfcd3cd4173367 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Wed, 23 Jun 2010 11:37:01 +0200 Subject: 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 --- client/display_channel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'client/display_channel.cpp') diff --git a/client/display_channel.cpp b/client/display_channel.cpp index 736e9fba..5469653c 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 unlock_event(new UnlockScreenEvent(screen())); - get_client().push_event(*unlock_event); + AutoRef unlock_event(new UnlockScreenEvent(screen())); + get_client().push_event(*unlock_event); + } AutoRef event(new DestroyPrimarySurfaceEvent(*this)); get_client().push_event(*event); -- cgit