summary refs log tree commit diff stats
path: root/ui/gtk.c
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2013-02-25 15:20:34 +0000
committerAnthony Liguori <aliguori@us.ibm.com>2013-02-26 13:29:51 -0600
commitcba68834c69f2d0fd04127301171fedac63d9b67 (patch)
treea3233aed04f9b7c2e2bdb9a57663033b26be4218 /ui/gtk.c
parentf963e4d0ca5b7704aed8048e2bc293597d333dfb (diff)
downloadfocaccia-qemu-cba68834c69f2d0fd04127301171fedac63d9b67.tar.gz
focaccia-qemu-cba68834c69f2d0fd04127301171fedac63d9b67.zip
Add compat for gdk_drawable_get_size on GTK3
GTK3 lacks the gdk_drawable_get_size method, so we create a
stub impl which gets the get_width/get_height mehtods instead

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 1361805646-6425-2-git-send-email-berrange@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'ui/gtk.c')
-rw-r--r--ui/gtk.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/gtk.c b/ui/gtk.c
index dcce36d243..dfffbb86f2 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -74,6 +74,16 @@
 
 #define MAX_VCS 10
 
+
+/* Compatibility define to let us build on both Gtk2 and Gtk3 */
+#if GTK_CHECK_VERSION(3, 0, 0)
+static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh)
+{
+    *ww = gdk_window_get_width(w);
+    *wh = gdk_window_get_height(w);
+}
+#endif
+
 typedef struct VirtualConsole
 {
     GtkWidget *menu_item;