qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 2/5] console: add dpy_ui_info_supported
Date: Fri,  8 May 2015 13:48:48 +0200	[thread overview]
Message-ID: <1431085731-6362-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1431085731-6362-1-git-send-email-kraxel@redhat.com>

Allow ui code to check whenever the emulated
display supports display change notifications.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 include/ui/console.h | 1 +
 ui/console.c         | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/include/ui/console.h b/include/ui/console.h
index 0b75896..e8b3a9e 100644
--- a/include/ui/console.h
+++ b/include/ui/console.h
@@ -228,6 +228,7 @@ void update_displaychangelistener(DisplayChangeListener *dcl,
                                   uint64_t interval);
 void unregister_displaychangelistener(DisplayChangeListener *dcl);
 
+bool dpy_ui_info_supported(QemuConsole *con);
 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info);
 
 void dpy_gfx_update(QemuConsole *con, int x, int y, int w, int h);
diff --git a/ui/console.c b/ui/console.c
index 248dd60..406c36b 100644
--- a/ui/console.c
+++ b/ui/console.c
@@ -1391,11 +1391,16 @@ static void dpy_set_ui_info_timer(void *opaque)
     con->hw_ops->ui_info(con->hw, con->head, &con->ui_info);
 }
 
+bool dpy_ui_info_supported(QemuConsole *con)
+{
+    return con->hw_ops->ui_info != NULL;
+}
+
 int dpy_set_ui_info(QemuConsole *con, QemuUIInfo *info)
 {
     assert(con != NULL);
     con->ui_info = *info;
-    if (!con->hw_ops->ui_info) {
+    if (!dpy_ui_info_supported(con)) {
         return -1;
     }
 
-- 
1.8.3.1

  parent reply	other threads:[~2015-05-08 11:49 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 11:48 [Qemu-devel] [PULL 0/5] gtk patch queue Gerd Hoffmann
2015-05-08 11:48 ` [Qemu-devel] [PULL 1/5] console: delayed ui_info guest notification Gerd Hoffmann
2015-05-08 11:48 ` Gerd Hoffmann [this message]
2015-05-08 11:48 ` [Qemu-devel] [PULL 3/5] gtk: add ui_info support Gerd Hoffmann
2015-05-08 11:48 ` [Qemu-devel] [PULL 4/5] gtk: create gtk.h Gerd Hoffmann
2015-05-08 11:48 ` [Qemu-devel] [PULL 5/5] gtk: update mouse position in mouse_set() Gerd Hoffmann
2015-05-11 11:00 ` [Qemu-devel] [PULL 0/5] gtk patch queue Peter Maydell

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=1431085731-6362-3-git-send-email-kraxel@redhat.com \
    --to=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 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).