summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-10-18 14:36:45 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-10-18 14:36:45 -0400
commit23a7232661bbc2058a483c52394a200f1803a6b0 (patch)
treeac70f85bc02201433f8c647afd59a4ba82b51035
parentb5572025d76b5bf4891b1ff260981680f2739992 (diff)
Add a couple of compatibility hacks for GTK+-2.HEADmaster
In tree.c, if GTK_MAJOR_VERSION==2, I provide an implementation of GTK 3's gtk_widget_get_preferred_size() for GTK 2. In util.c, if GDK_WINDOWNING_X11 is defined, but GDK_IS_X11_DISPLAY() isn't, I define it to always return 1.
-rw-r--r--src/tree.c9
-rw-r--r--src/util.c4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/tree.c b/src/tree.c
index a8b324f..7f20b92 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -30,6 +30,15 @@
#include "zenity.h"
#include "util.h"
+#if GTK_MAJOR_VERSION == 2
+static void
+gtk_widget_get_preferred_size (GtkWidget *widget, GtkRequisition *minimum_size, GtkRequisition *natural_size)
+{
+ gtk_widget_size_request(widget, natural_size);
+ gtk_widget_get_size_request(widget, &(minimum_size->width), &(minimum_size->height));
+}
+#endif
+
#define MAX_ELEMENTS_BEFORE_SCROLLING 5
#define PRINT_HIDE_COLUMN_SEPARATOR ","
diff --git a/src/util.c b/src/util.c
index d63aeca..23ba3ab 100644
--- a/src/util.c
+++ b/src/util.c
@@ -45,6 +45,10 @@
#define ZENITY_ERROR_DEFAULT -1
#define ZENITY_EXTRA_DEFAULT 127
+#if defined(GDK_WINDOWING_X11) && !defined(GDK_IS_X11_DISPLAY)
+#define GDK_IS_X11_DISPLAY(display) 1
+#endif
+
GtkBuilder*
zenity_util_load_ui_file (const gchar *root_widget, ...)
{