All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v3 1/3] vnc: move check into vnc_cursor_define
Date: Tue, 12 Jan 2021 18:28:38 +0400	[thread overview]
Message-ID: <CAMxuvaw7+p-oy1itYCWZnK-PEi9QBxxwS67aAy2Sdr5fnGyr-g@mail.gmail.com> (raw)
In-Reply-To: <20210112134120.2031837-2-kraxel@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

On Tue, Jan 12, 2021 at 5:41 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> Move the check whenever a cursor exists into the vnc_cursor_define()
> function so callers don't have to do it.
>
> Suggested-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
>

thanks
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

---
>  ui/vnc.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index 7452ac7df2ce..84c4972b895b 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -792,9 +792,7 @@ static void vnc_dpy_switch(DisplayChangeListener *dcl,
>      QTAILQ_FOREACH(vs, &vd->clients, next) {
>          vnc_colordepth(vs);
>          vnc_desktop_resize(vs);
> -        if (vs->vd->cursor) {
> -            vnc_cursor_define(vs);
> -        }
> +        vnc_cursor_define(vs);
>          memset(vs->dirty, 0x00, sizeof(vs->dirty));
>          vnc_set_area_dirty(vs->dirty, vd, 0, 0,
>                             vnc_width(vd),
> @@ -928,6 +926,10 @@ static int vnc_cursor_define(VncState *vs)
>      QEMUCursor *c = vs->vd->cursor;
>      int isize;
>
> +    if (!vs->vd->cursor) {
> +        return -1;
> +    }
> +
>      if (vnc_has_feature(vs, VNC_FEATURE_ALPHA_CURSOR)) {
>          vnc_lock_output(vs);
>          vnc_write_u8(vs,  VNC_MSG_SERVER_FRAMEBUFFER_UPDATE);
> @@ -2137,9 +2139,7 @@ static void set_encodings(VncState *vs, int32_t
> *encodings, size_t n_encodings)
>      vnc_desktop_resize(vs);
>      check_pointer_type_change(&vs->mouse_mode_notifier, NULL);
>      vnc_led_state_change(vs);
> -    if (vs->vd->cursor) {
> -        vnc_cursor_define(vs);
> -    }
> +    vnc_cursor_define(vs);
>  }
>
>  static void set_pixel_conversion(VncState *vs)
> --
> 2.29.2
>
>

[-- Attachment #2: Type: text/html, Size: 2797 bytes --]

  reply	other threads:[~2021-01-12 14:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 13:41 [PATCH v3 0/3] vnc: support some new extensions Gerd Hoffmann
2021-01-12 13:41 ` [PATCH v3 1/3] vnc: move check into vnc_cursor_define Gerd Hoffmann
2021-01-12 14:28   ` Marc-André Lureau [this message]
2021-01-14 17:33   ` Daniel P. Berrangé
2021-01-12 13:41 ` [PATCH v3 2/3] vnc: move initialization to framebuffer_update_request Gerd Hoffmann
2021-01-14 17:39   ` Daniel P. Berrangé
2021-01-12 13:41 ` [PATCH v3 3/3] vnc: add support for extended desktop resize Gerd Hoffmann
2021-01-14 17:43   ` Daniel P. Berrangé
2021-01-14 17:31 ` [PATCH v3 0/3] vnc: support some new extensions Daniel P. Berrangé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMxuvaw7+p-oy1itYCWZnK-PEi9QBxxwS67aAy2Sdr5fnGyr-g@mail.gmail.com \
    --to=marcandre.lureau@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.