summaryrefslogtreecommitdiffstats
path: root/client/display_channel.cpp
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2010-06-22 16:35:48 +0200
committerAlexander Larsson <alexl@redhat.com>2010-06-22 17:34:45 +0200
commit652c13e71b8c203fc701edb6bad365c50e7cf1aa (patch)
tree05361209474910d07812a44f75f95536675a8037 /client/display_channel.cpp
parent2788b2ec462da943f5899429bd9bb3ba0ec5c8b9 (diff)
downloadspice-652c13e71b8c203fc701edb6bad365c50e7cf1aa.tar.gz
spice-652c13e71b8c203fc701edb6bad365c50e7cf1aa.tar.xz
spice-652c13e71b8c203fc701edb6bad365c50e7cf1aa.zip
Implement display_mode message needed for backwards compat
Diffstat (limited to 'client/display_channel.cpp')
-rw-r--r--client/display_channel.cpp12
1 files changed, 12 insertions, 0 deletions
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<int>& 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;