From 652c13e71b8c203fc701edb6bad365c50e7cf1aa Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 22 Jun 2010 16:35:48 +0200 Subject: [PATCH] Implement display_mode message needed for backwards compat --- client/display_channel.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/client/display_channel.cpp b/client/display_channel.cpp index 67c3083e..736e9fba 100644 --- a/client/display_channel.cpp +++ b/client/display_channel.cpp @@ -615,6 +615,7 @@ DisplayChannel::DisplayChannel(RedClient& client, uint32_t id, handler->set_handler(SPICE_MSG_DISCONNECTING, &DisplayChannel::handle_disconnect); handler->set_handler(SPICE_MSG_NOTIFY, &DisplayChannel::handle_notify); + handler->set_handler(SPICE_MSG_DISPLAY_MODE, &DisplayChannel::handle_mode); handler->set_handler(SPICE_MSG_DISPLAY_MARK, &DisplayChannel::handle_mark); handler->set_handler(SPICE_MSG_DISPLAY_RESET, &DisplayChannel::handle_reset); @@ -1195,6 +1196,17 @@ void DisplayChannel::create_canvas(int surface_id, const std::vector& canva } } +void DisplayChannel::handle_mode(RedPeer::InMessage* message) +{ + SpiceMsgDisplayMode *mode = (SpiceMsgDisplayMode *)message->data(); + + if (screen()) { + destroy_primary_surface(); + } + create_primary_surface(mode->x_res, mode->y_res, + mode->bits == 32 ? SPICE_SURFACE_FMT_32_xRGB : SPICE_SURFACE_FMT_16_555); +} + void DisplayChannel::handle_mark(RedPeer::InMessage *message) { _mark = true;