[Libguestfs] [p2v PATCH 1/3] Copy GtkAttachOptions from GTK >= 3.4

Pino Toscano ptoscano at redhat.com
Fri Aug 30 10:34:47 UTC 2019


GtkAttachOptions is part of GtkTable, which is used only with GTK < 3.4;
however, these enum values are used also in the GtkGrid version of the
code, so they are needed also when disabling deprecated stuff.

As easy solution to make the current code working without deprecated
stuff of GTK, copy the GtkAttachOptions enum when using GtkGrid (i.e.
with GTK >= 3.4).
---
 gui-gtk3-compat.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gui-gtk3-compat.h b/gui-gtk3-compat.h
index a29e7b4..212c3af 100644
--- a/gui-gtk3-compat.h
+++ b/gui-gtk3-compat.h
@@ -50,6 +50,15 @@ gdk_event_get_button (const GdkEvent *event, guint *button)
 #endif
 
 #if GTK_CHECK_VERSION(3,4,0)   /* gtk >= 3.4 */
+/* Copy this enum from GtkTable, as when building without deprecated
+ * functions this is not automatically pulled in.
+ */
+typedef enum
+{
+  GTK_EXPAND = 1 << 0,
+  GTK_SHRINK = 1 << 1,
+  GTK_FILL   = 1 << 2
+} GtkAttachOptions;
 /* GtkGrid is sufficiently similar to GtkTable that we can just
  * redefine these functions.
  */
-- 
2.21.0




More information about the Libguestfs mailing list