summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorSamuel Lidén Borell <samuel@slbdata.se>2011-06-22 22:09:24 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2011-06-22 22:09:24 +0200
commit852c674490f8d005c05593e46881e9da674f218b (patch)
tree8e6c64ba895933232c172e5ca07defa83b23a5d6 /client/gtk.c
parent3852c1b4e9639c0cc27a4c79f2ea48f25fc1681e (diff)
downloadfribid-852c674490f8d005c05593e46881e9da674f218b.tar.gz
fribid-852c674490f8d005c05593e46881e9da674f218b.tar.bz2
fribid-852c674490f8d005c05593e46881e9da674f218b.zip
Fix compile error on GTK 3.0
gdk_window_foreign_new was deprecated in 2.24 and removed in 3.0. We still use this function on 2.24 so builds created on this version can run on older versions (2.18 is supported by FriBID).
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/client/gtk.c b/client/gtk.c
index 025f360..5001c9c 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -27,6 +27,7 @@
#include <stdlib.h>
#include <string.h>
#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
#include <glib.h>
#include <assert.h>
#include <errno.h>
@@ -140,7 +141,13 @@ static void makeDialogTransient(GtkDialog *dialog, unsigned long parentWindowId)
bool transientOk = false;
if (parentWindowId != PLATFORM_NO_WINDOW) {
+#if GTK_CHECK_VERSION(3, 0, 0)
+ GdkDisplay *display = gdk_display_get_default();
+ GdkWindow *parent = gdk_x11_window_foreign_new_for_display(display,
+ (Window)parentWindowId);
+#else
GdkWindow *parent = gdk_window_foreign_new((GdkNativeWindow)parentWindowId);
+#endif
if (parent != NULL) {
gtk_widget_realize(GTK_WIDGET(dialog));
GdkWindow *ourWindow = gtk_widget_get_window(GTK_WIDGET(dialog));