qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH ui/gtk 01/13] Add compat for gdk_drawable_get_size o


From: Daniel P. Berrange
Subject: [Qemu-devel] [PATCH ui/gtk 01/13] Add compat for gdk_drawable_get_size on GTK3
Date: Mon, 25 Feb 2013 15:20:34 +0000

From: "Daniel P. Berrange" <address@hidden>

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 <address@hidden>
---
 ui/gtk.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ui/gtk.c b/ui/gtk.c
index dcce36d..dfffbb8 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;
-- 
1.8.1.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]