diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/display_channel.cpp | 12 |
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; |