Re: [RFC PATCH spice-server v3 12/20] stream-channel: Do not show an empty blank screen on start

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Jonathon Jongsma <jjongsma@xxxxxxxxxx>


On Wed, 2017-08-23 at 10:14 +0100, Frediano Ziglio wrote:
> Start showing something when we have a surface and stream
> instead of showing a blank screen which is now not useful.
> Was useful for debugging purposes to understand that the
> new channel was sending messages correctly to client and
> client could handle them.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
>  server/stream-channel.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)
> 
> diff --git a/server/stream-channel.c b/server/stream-channel.c
> index 7e3e8f07..b9bb2649 100644
> --- a/server/stream-channel.c
> +++ b/server/stream-channel.c
> @@ -349,8 +349,13 @@ stream_channel_connect(RedChannel *red_channel,
> RedClient *red_client, RedsStrea
>      red_channel_client_ack_zero_messages_window(rcc);
>  
>      // "emulate" dcc_start
> -    // TODO only if "surface"
>      red_channel_client_pipe_add_empty_msg(rcc,
> SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES);
> +
> +    // only if "surface"
> +    if (channel->width == 0 || channel->height == 0) {
> +        return;
> +    }
> +
>      // pass proper data
>      red_channel_client_pipe_add_type(rcc,
> RED_PIPE_ITEM_TYPE_SURFACE_CREATE);
>      // surface data
> @@ -397,8 +402,8 @@ static void
>  stream_channel_init(StreamChannel *channel)
>  {
>      channel->stream_id = -1;
> -    channel->width = 1024;
> -    channel->height = 768;
> +    channel->width = 0;
> +    channel->height = 0;
>  }
>  
>  static RedPipeItem *
> @@ -419,11 +424,14 @@ stream_channel_change_format(StreamChannel
> *channel, const StreamMsgFormat *fmt)
>  
>      // send new create surface if required
>      if (channel->width != fmt->width || channel->height != fmt-
> >height) {
> +        if (channel->width != 0 && channel->height != 0) {
> +            red_channel_pipes_add_type(red_channel,
> RED_PIPE_ITEM_TYPE_SURFACE_DESTROY);
> +        }
>          channel->width = fmt->width;
>          channel->height = fmt->height;
> -        red_channel_pipes_add_type(red_channel,
> RED_PIPE_ITEM_TYPE_SURFACE_DESTROY);
>          red_channel_pipes_add_type(red_channel,
> RED_PIPE_ITEM_TYPE_SURFACE_CREATE);
>          // TODO monitors config ??
> +        red_channel_pipes_add_empty_msg(red_channel,
> SPICE_MSG_DISPLAY_MARK);
>      }
>  
>      // allocate a new stream id
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]