[Spice-devel] [PATCH spice 2/4] main-channel: Add a main_channel_client_push_notify function
Hans de Goede
hdegoede at redhat.com
Thu Mar 14 09:27:18 PDT 2013
Sometimes we want to send a notify to a single client, rather then to
all of them.
Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
server/main_channel.c | 7 ++++++-
server/main_channel.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/server/main_channel.c b/server/main_channel.c
index 55c3291..618f5bf 100644
--- a/server/main_channel.c
+++ b/server/main_channel.c
@@ -575,13 +575,18 @@ void main_channel_push_uuid(MainChannelClient *mcc, const uint8_t uuid[16])
red_channel_client_pipe_add_push(&mcc->base, item);
}
-// TODO - some notifications are new client only (like "keyboard is insecure" on startup)
void main_channel_push_notify(MainChannel *main_chan, const char *msg)
{
red_channel_pipes_new_add_push(&main_chan->base,
main_notify_item_new, (void *)msg);
}
+void main_channel_client_push_notify(MainChannelClient *mcc, const char *msg)
+{
+ PipeItem *item = main_notify_item_new(&mcc->base, (void *)msg, 1);
+ red_channel_client_pipe_add_push(&mcc->base, item);
+}
+
static uint64_t get_time_stamp(void)
{
struct timespec time_space;
diff --git a/server/main_channel.h b/server/main_channel.h
index 5f77b74..56663b7 100644
--- a/server/main_channel.h
+++ b/server/main_channel.h
@@ -61,6 +61,7 @@ void main_channel_push_init(MainChannelClient *mcc, int display_channels_hint,
int current_mouse_mode, int is_client_mouse_allowed, int multi_media_time,
int ram_hint);
void main_channel_push_notify(MainChannel *main_chan, const char *msg);
+void main_channel_client_push_notify(MainChannelClient *mcc, const char *msg);
void main_channel_push_multi_media_time(MainChannel *main_chan, int time);
int main_channel_getsockname(MainChannel *main_chan, struct sockaddr *sa, socklen_t *salen);
int main_channel_getpeername(MainChannel *main_chan, struct sockaddr *sa, socklen_t *salen);
--
1.8.1.4
More information about the Spice-devel
mailing list