From: Paolo Bonzini <pbonzini@redhat.com>
To: Dongwon Kim <dongwon.kim@intel.com>, qemu-devel@nongnu.org
Cc: sweeaun <swee.aun.khor@intel.com>,
Khairul Anuar Romli <khairul.anuar.romli@intel.com>,
Vivek Kasireddy <vivek.kasireddy@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>
Subject: Re: [PATCH] ui/gtk: mon_num parameter to specify target monitor for launching Qemu
Date: Fri, 19 Nov 2021 10:24:08 +0100 [thread overview]
Message-ID: <0457933c-610d-0f78-7ae3-07648280e838@redhat.com> (raw)
In-Reply-To: <20211118225127.26147-1-dongwon.kim@intel.com>
On 11/18/21 23:51, Dongwon Kim wrote:
> +# @mon-num: Indicate monitor where Qemu window is lauched. mon-num
> +# could be any number from -1 to (total num of monitors - 1).
> +# (default: -1: use default monitor)
> +# since 6.2
There is no need to accept -1; the opts->u.gtk struct uses a separate
boolean field to indicate the default. Instead, the parameter should be
an unsigned integer ("uint32").
Also please use "monitor", not "mon-num". We usually avoid abbreviations.
> + if (opts->u.gtk.has_mon_num && opts->u.gtk.mon_num &&
> + opts->u.gtk.mon_num >= 0) {
Rejecting 0 ("opts->u.gtk.mon_num") is incorrect. If you declare it as
unsigned, you can just use "if (opts->u.gtk.has_mon_num").
Thanks,
Paolo
> + GdkRectangle mon_dest;
> + if (opts->u.gtk.mon_num < gdk_display_get_n_monitors(window_display)) {
> + gdk_monitor_get_geometry(
> + gdk_display_get_monitor(window_display, opts->u.gtk.mon_num),
> + &mon_dest);
> + gtk_window_move(GTK_WINDOW(s->window), mon_dest.x, mon_dest.y);
> + }
> + }
> if (opts->has_full_screen &&
> opts->full_screen) {
> gtk_menu_item_activate(GTK_MENU_ITEM(s->full_screen_item));
> --
next prev parent reply other threads:[~2021-11-19 9:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-18 22:51 [PATCH] ui/gtk: mon_num parameter to specify target monitor for launching Qemu Dongwon Kim
2021-11-19 8:53 ` Philippe Mathieu-Daudé
2021-11-19 9:24 ` Paolo Bonzini [this message]
2021-11-19 20:10 ` [PATCH v2] ui/gtk: new param monitor to specify target monitor for launching QEMU Dongwon Kim
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=0457933c-610d-0f78-7ae3-07648280e838@redhat.com \
--to=pbonzini@redhat.com \
--cc=dongwon.kim@intel.com \
--cc=khairul.anuar.romli@intel.com \
--cc=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=swee.aun.khor@intel.com \
--cc=vivek.kasireddy@intel.com \
/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).