summaryrefslogtreecommitdiffstats
path: root/client/display_channel.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-23 11:37:01 +0200
committerAlexander Larsson <alexl@redhat.com>2010-06-23 11:37:01 +0200
commitf35ac2049a84fd5edbea43f679dfcd3cd4173367 (patch)
treec8facd52c5fc0a0ab17dcb9f06871468f63da0ee /client/display_channel.cpp
parent72cf104c2897b4dd124c8a65df02e6895a9f1d88 (diff)
downloadspice-f35ac2049a84fd5edbea43f679dfcd3cd4173367.tar.gz
spice-f35ac2049a84fd5edbea43f679dfcd3cd4173367.tar.xz
spice-f35ac2049a84fd5edbea43f679dfcd3cd4173367.zip
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
Diffstat (limited to 'client/display_channel.cpp')
-rw-r--r--client/display_channel.cpp10
1 files changed, 5 insertions, 5 deletions
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<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);