summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Carlson <marcus@mejlamej.nu>2010-06-09 22:37:06 +0200
committerSamuel Lidén Borell <samuel@slbdata.se>2010-06-10 22:07:24 +0200
commit08ad5a6e53db09c74ae2b0477c22e8d02acb3334 (patch)
treebf9f30f505563a6637dc4a35b61e7020f6a42641
parent979889751a0cb5d224b1c677b9c78d555ad0645e (diff)
downloadfribid-08ad5a6e53db09c74ae2b0477c22e8d02acb3334.tar.gz
fribid-08ad5a6e53db09c74ae2b0477c22e8d02acb3334.tar.bz2
fribid-08ad5a6e53db09c74ae2b0477c22e8d02acb3334.zip
Use GSEAL when building
This prevents direct access to data structures in GTK (and GLib in the future). Thanks to Marcus Carlson for this patch!
-rw-r--r--client/Makefile2
-rw-r--r--client/gtk.c6
-rw-r--r--plugin/Makefile2
3 files changed, 6 insertions, 4 deletions
diff --git a/client/Makefile b/client/Makefile
index 76f643a..be9ce1e 100644
--- a/client/Makefile
+++ b/client/Makefile
@@ -22,7 +22,7 @@
CFLAGS ?= -O2 -g
COMMONCFLAGS=$(CFLAGS) -Wall -Wextra -std=c99 -pedantic -Wno-unused-parameter
-CCFLAGS=$(COMMONCFLAGS) -I../npapi/include `pkg-config --cflags 'gtk+-2.0 >= 2.12' glib-2.0 'nss >= 3.10' nspr` -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DG_DISABLE_DEPRECATED=1
+CCFLAGS=$(COMMONCFLAGS) -I../npapi/include `pkg-config --cflags 'gtk+-2.0 >= 2.12' glib-2.0 'nss >= 3.10' nspr` -DGTK_DISABLE_DEPRECATED=1 -DGDK_DISABLE_DEPRECATED=1 -DG_DISABLE_DEPRECATED=1 -DGSEAL_ENABLE
# You may have to add -lpthread after $(LDFLAGS) on OpenBSD
LINKFLAGS=$(CFLAGS) $(LDFLAGS) -Wl,--as-needed
LIBS=`pkg-config --libs 'gtk+-2.0 >= 2.12' glib-2.0 'nss >= 3.10' nspr`
diff --git a/client/gtk.c b/client/gtk.c
index a668b3e..125c347 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -248,9 +248,11 @@ void platform_startSign(const char *url, const char *hostname, const char *ip,
GdkWindow *parent = gdk_window_foreign_new((GdkNativeWindow)parentWindowId);
if (parent != NULL) {
gtk_widget_realize(GTK_WIDGET(signDialog));
- // Only available in GTK 2.14+
- //GdkWindow *ourWindow = gtk_widget_get_window(GTK_WINDOW(signDialog));
+#if GTK_CHECK_VERSION(2, 14, 0)
+ GdkWindow *ourWindow = gtk_widget_get_window(GTK_WIDGET(signDialog));
+#else
GdkWindow *ourWindow = GTK_WIDGET(signDialog)->window;
+#endif
if (ourWindow != NULL) {
gdk_window_set_transient_for(ourWindow, parent);
transientOk = true;
diff --git a/plugin/Makefile b/plugin/Makefile
index 65976ca..b25717c 100644
--- a/plugin/Makefile
+++ b/plugin/Makefile
@@ -22,7 +22,7 @@
CFLAGS ?= -O2 -g
COMMONCFLAGS=$(CFLAGS) -Wall -Wextra -std=c99 -pedantic -Wno-unused-parameter
-CCFLAGS=$(COMMONCFLAGS) -I../npapi -fPIC -fvisibility=hidden `pkg-config --cflags glib-2.0 x11` -DG_DISABLE_DEPRECATED=1
+CCFLAGS=$(COMMONCFLAGS) -I../npapi -fPIC -fvisibility=hidden `pkg-config --cflags glib-2.0 x11` -DG_DISABLE_DEPRECATED=1 -DGSEAL_ENABLE
LINKFLAGS=$(CFLAGS) $(LDFLAGS) -Wl,-z,defs,-soname,libfribidplugin.so
LIBS=-lc `pkg-config --libs glib-2.0`