All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Nikola Pavlica <pavlica.nikola@gmail.com>,
	qemu-devel@nongnu.org, Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH] display/gtk: get proper refreshrate
Date: Mon, 30 Dec 2019 23:59:20 +0100	[thread overview]
Message-ID: <dc998ea3-4fbe-8ecb-65f5-0af59ddd0d6f@redhat.com> (raw)
In-Reply-To: <8531e41f28df7f4bebe4db257ff95e92f5145afc.camel@gmail.com>

Hi Nikola,

Thanks for your patch!

On 12/30/19 6:28 PM, Nikola Pavlica wrote:
>  From 70c95b18fa056b2dd0ecc202ab517bc775b986da Mon Sep 17 00:00:00 2001
> From: Nikola Pavlica <pavlica.nikola@gmail.com>
> Date: Mon, 30 Dec 2019 18:17:35 +0100
> Subject: [PATCH] display/gtk: get proper refreshrate

Can you describe here the problem you encountered, and how your patch 
fixes it?

> 
> Signed-off-by: Nikola Pavlica <pavlica.nikola@gmail.com>
> ---
>   ui/gtk.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/ui/gtk.c b/ui/gtk.c
> index 692ccc7bbb..7a041457f2 100644
> --- a/ui/gtk.c
> +++ b/ui/gtk.c
> @@ -2259,6 +2259,11 @@ static void gtk_display_init(DisplayState *ds,
> DisplayOptions *opts)
>           opts->u.gtk.grab_on_hover) {
>           gtk_menu_item_activate(GTK_MENU_ITEM(s->grab_on_hover_item));
>       }
> +
> +    GdkDisplay *display = gdk_display_get_default();

Can we use window_display declared earlier instead?

     window_display = gtk_widget_get_display(s->window);

If you look at the CODING_STYLE.rst file referenced here:
https://wiki.qemu.org/Contribute/SubmitAPatch#Use_the_QEMU_coding_style
It states:

   Declarations
   ============

   Mixed declarations (interleaving statements and declarations
   within blocks) are generally not allowed; declarations should
   be at the beginning of blocks.

So you should move the declaration of both display/monitor variables 
earlier, around line 2192.

> +    GdkMonitor *monitor = gdk_display_get_primary_monitor(display);
> +    vc->gfx.dcl.update_interval = 1000000 /
> +        gdk_monitor_get_refresh_rate(monitor);

Now looking at this line, I think this should be done in the 
gd_vc_gfx_init() function (line 2029, before the 
register_displaychangelistener() call).

>   }
>   
>   static void early_gtk_display_init(DisplayOptions *opts)
> 

As suggested on IRC, your patch have more chances to get reviewed if you 
Cc its maintainers. See this help here:
https://wiki.qemu.org/Contribute/SubmitAPatch#CC_the_relevant_maintainer

In this case we get:

$ ./scripts/get_maintainer.pl -f ui/gtk.c
Gerd Hoffmann <kraxel@redhat.com> (odd fixer:Graphics)
qemu-devel@nongnu.org (open list:All patches CC here)

I'm Cc'ing Gerd for you.

Regards,

Phil.



  reply	other threads:[~2019-12-30 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 17:28 [PATCH] display/gtk: get proper refreshrate Nikola Pavlica
2019-12-30 22:59 ` Philippe Mathieu-Daudé [this message]
     [not found]   ` <2ee36cb0103b60a4a0655a4c127469e6f49f8d46.camel@gmail.com>
2019-12-31 13:48     ` Philippe Mathieu-Daudé

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=dc998ea3-4fbe-8ecb-65f5-0af59ddd0d6f@redhat.com \
    --to=philmd@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=pavlica.nikola@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 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.