qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Alexander Orzechowski <orzechowski.alexander@gmail.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 2/2] ui: fix incorrect pointer position on highdpi with gtk
Date: Mon, 22 Nov 2021 13:15:53 +0100	[thread overview]
Message-ID: <f701c999-0a08-75d0-e715-c7cc6aeb494e@redhat.com> (raw)
In-Reply-To: <20211121065504.29101-3-orzechowski.alexander@gmail.com>

On 11/21/21 07:55, Alexander Orzechowski wrote:
> Signed-off-by: Alexander Orzechowski <orzechowski.alexander@gmail.com>
> ---
>  ui/gtk.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index d2892ea6b4..b2670142b5 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -838,10 +838,11 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
>  {
>      VirtualConsole *vc = opaque;
>      GtkDisplayState *s = vc->s;
> +    GdkWindow *window;
>      int x, y;
>      int mx, my;
>      int fbh, fbw;
> -    int ww, wh;
> +    int ww, wh, ws;
>  
>      if (!vc->gfx.ds) {
>          return TRUE;
> @@ -850,8 +851,10 @@ static gboolean gd_motion_event(GtkWidget *widget, GdkEventMotion *motion,
>      fbw = surface_width(vc->gfx.ds) * vc->gfx.scale_x;
>      fbh = surface_height(vc->gfx.ds) * vc->gfx.scale_y;
>  
> -    ww = gdk_window_get_width(gtk_widget_get_window(vc->gfx.drawing_area));
> -    wh = gdk_window_get_height(gtk_widget_get_window(vc->gfx.drawing_area));
> +    window = gtk_widget_get_window(vc->gfx.drawing_area);
> +    ww = gdk_window_get_width(window);
> +    wh = gdk_window_get_height(window);
> +    ws = gdk_window_get_scale_factor (window);

Please follow the coding style and remove the extra space.

Otherwise LGTM.



      reply	other threads:[~2021-11-22 12:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-21  6:55 [PATCH 0/2] Fix trivial errors with highdpi/wayland Alexander Orzechowski
2021-11-21  6:55 ` [PATCH 1/2] ui: fix incorrect scaling on highdpi with gtk/opengl Alexander Orzechowski
2021-11-22 12:16   ` Philippe Mathieu-Daudé
2021-11-21  6:55 ` [PATCH 2/2] ui: fix incorrect pointer position on highdpi with gtk Alexander Orzechowski
2021-11-22 12:15   ` Philippe Mathieu-Daudé [this message]

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=f701c999-0a08-75d0-e715-c7cc6aeb494e@redhat.com \
    --to=philmd@redhat.com \
    --cc=orzechowski.alexander@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).