summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2019-05-25 08:35:36 +0100
committerFrediano Ziglio <fziglio@redhat.com>2019-05-31 05:59:33 +0100
commit519e44535e2820d295685d22afc22009c2faa6e0 (patch)
treef8a54e74b596c781f8aac5c7235925a39b1c401e
parent172b676328385df1587e7a20560a77825264a715 (diff)
try to use covariance to avoid some castscpp3_save_manual_rcc_20190531
CCC knows the channel is a CC !
-rw-r--r--server/cursor-channel-client.h4
-rw-r--r--server/cursor-channel.cpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/server/cursor-channel-client.h b/server/cursor-channel-client.h
index bfb69a5e..bc557599 100644
--- a/server/cursor-channel-client.h
+++ b/server/cursor-channel-client.h
@@ -40,6 +40,10 @@ struct CursorChannelClient final: public CommonGraphicsChannelClient
void reset_cursor_cache();
RedCacheItem* cache_find(uint64_t id);
int cache_add(uint64_t id, size_t size);
+ CursorChannel* get_channel()
+ {
+ return CURSOR_CHANNEL(CommonGraphicsChannelClient::get_channel());
+ }
protected:
virtual void on_disconnect() override;
diff --git a/server/cursor-channel.cpp b/server/cursor-channel.cpp
index ff29f425..4797abea 100644
--- a/server/cursor-channel.cpp
+++ b/server/cursor-channel.cpp
@@ -122,7 +122,7 @@ red_marshall_cursor_init(CursorChannelClient *ccc, SpiceMessage &message,
CursorChannel *cursor_channel;
SpiceMsgCursorInit msg;
- cursor_channel = CURSOR_CHANNEL(ccc->get_channel());
+ cursor_channel = ccc->get_channel();
message.init(SPICE_MSG_CURSOR_INIT);
msg.visible = cursor_channel->cursor_visible;
@@ -139,7 +139,7 @@ static void red_marshall_cursor(CursorChannelClient *ccc,
RedCursorPipeItem *cursor_pipe_item)
{
SpiceMarshaller *m = message.get_marshaller();
- CursorChannel *cursor_channel = CURSOR_CHANNEL(ccc->get_channel());
+ CursorChannel *cursor_channel = ccc->get_channel();
RedCursorPipeItem *item = cursor_pipe_item;
RedCursorCmd *cmd;