2010-12-22 Xan Lopez <xlopez@igalia.com>
authorxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 20:53:56 +0000 (20:53 +0000)
committerxan@webkit.org <xan@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 22 Dec 2010 20:53:56 +0000 (20:53 +0000)
        Reviewed by Gustavo Noronha.

        [GTK] Compilation fixes with GTK+ 2.91.7
        https://bugs.webkit.org/show_bug.cgi?id=51487

        * configure.ac: depend on GTK+ 2.91.7 when using GTK+ 3.x.

WebCore:

2010-12-22  Xan Lopez  <xlopez@igalia.com>

        Reviewed by Gustavo Noronha.

        [GTK] Compilation fixes with GTK+ 2.91.7
        https://bugs.webkit.org/show_bug.cgi?id=51487

        * platform/gtk/GtkVersioning.h: do not define GDK_DISPLAY for
        backwards compatibility, it's now defined again in GTK+ 3.x.
        * platform/gtk/PasteboardHelper.cpp: do not call GDK functions to
        initialize global static variables (!). These are called when the
        .so is loaded, and they now require GType to be initialized and
        will crash. Initialize them once from the ctor, which is a more
        common pattern anyway.
        (WebCore::initGdkAtoms): new method to initialize static variables.
        (WebCore::PasteboardHelper::PasteboardHelper): call it.
        * plugins/gtk/PluginViewGtk.cpp: do not include gdkconfig.h when
        using GTK+ 3.x, since it's no longer installed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@74496 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
WebCore/ChangeLog
WebCore/platform/gtk/GtkVersioning.h
WebCore/platform/gtk/PasteboardHelper.cpp
WebCore/plugins/gtk/PluginViewGtk.cpp
configure.ac

index 0daa39c..9f90b0e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-12-22  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        [GTK] Compilation fixes with GTK+ 2.91.7
+        https://bugs.webkit.org/show_bug.cgi?id=51487
+
+        * configure.ac: depend on GTK+ 2.91.7 when using GTK+ 3.x.
+
 2010-12-22  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Reviewed by Antonio Gomes.
index 37e2e3b..24e2221 100644 (file)
@@ -1,3 +1,22 @@
+2010-12-22  Xan Lopez  <xlopez@igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        [GTK] Compilation fixes with GTK+ 2.91.7
+        https://bugs.webkit.org/show_bug.cgi?id=51487
+
+        * platform/gtk/GtkVersioning.h: do not define GDK_DISPLAY for
+        backwards compatibility, it's now defined again in GTK+ 3.x.
+        * platform/gtk/PasteboardHelper.cpp: do not call GDK functions to
+        initialize global static variables (!). These are called when the
+        .so is loaded, and they now require GType to be initialized and
+        will crash. Initialize them once from the ctor, which is a more
+        common pattern anyway.
+        (WebCore::initGdkAtoms): new method to initialize static variables.
+        (WebCore::PasteboardHelper::PasteboardHelper): call it.
+        * plugins/gtk/PluginViewGtk.cpp: do not include gdkconfig.h when
+        using GTK+ 3.x, since it's no longer installed.
+
 2010-12-22  Dirk Schulze  <krit@wbekit.org>
 
         Reviewed by Nikolas Zimmermann.
index 9c38aba..11d1f8a 100644 (file)
@@ -31,7 +31,6 @@ G_BEGIN_DECLS
 
 // Macros to avoid deprecation checking churn
 #ifndef GTK_API_VERSION_2
-#define GDK_DISPLAY() (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()))
 #define GDK_WINDOW_XWINDOW(window) (gdk_x11_window_get_xid(window))
 #else
 GdkPixbuf* gdk_pixbuf_get_from_surface(cairo_surface_t* surface, int srcX, int srcY,
index 228d5e9..4428be0 100644 (file)
 
 namespace WebCore {
 
-static GdkAtom textPlainAtom = gdk_atom_intern("text/plain;charset=utf-8", FALSE);
-static GdkAtom markupAtom = gdk_atom_intern("text/html", FALSE);
-static GdkAtom netscapeURLAtom = gdk_atom_intern("_NETSCAPE_URL", FALSE);
-static GdkAtom uriListAtom = gdk_atom_intern("text/uri-list", FALSE);
-static String gMarkupPrefix = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
+static GdkAtom textPlainAtom;
+static GdkAtom markupAtom;
+static GdkAtom netscapeURLAtom;
+static GdkAtom uriListAtom;
+static String gMarkupPrefix;
 
 static void removeMarkupPrefix(String& markup)
 {
@@ -49,9 +49,26 @@ static void removeMarkupPrefix(String& markup)
         markup.remove(0, gMarkupPrefix.length());
 }
 
+static void initGdkAtoms()
+{
+    static gboolean initialized = FALSE;
+
+    if (initialized)
+        return;
+
+    initialized = TRUE;
+
+    textPlainAtom = gdk_atom_intern("text/plain;charset=utf-8", FALSE);
+    markupAtom = gdk_atom_intern("text/html", FALSE);
+    netscapeURLAtom = gdk_atom_intern("_NETSCAPE_URL", FALSE);
+    uriListAtom = gdk_atom_intern("text/uri-list", FALSE);
+    gMarkupPrefix = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">";
+}
+
 PasteboardHelper::PasteboardHelper()
     : m_targetList(gtk_target_list_new(0, 0))
 {
+    initGdkAtoms();
 }
 
 PasteboardHelper::~PasteboardHelper()
index 925ab79..ec855a2 100644 (file)
@@ -62,7 +62,9 @@
 #include <runtime/JSLock.h>
 #include <runtime/JSValue.h>
 
+#ifdef GTK_API_VERSION_2
 #include <gdkconfig.h>
+#endif
 #include <gtk/gtk.h>
 
 #if defined(XP_UNIX)
index a00b296..81d0b67 100644 (file)
@@ -199,7 +199,7 @@ case "$with_gtk" in
           GAIL_PC_NAME=gail
           GAIL_REQUIRED_VERSION=1.8
           ;;
-     3.0) GTK_REQUIRED_VERSION=2.91
+     3.0) GTK_REQUIRED_VERSION=2.91.7
           GTK_API_VERSION=3.0
           WEBKITGTK_API_MAJOR_VERSION=3
           WEBKITGTK_API_MINOR_VERSION=0