2010-10-07 Carlos Garcia Campos <cgarcia@igalia.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Oct 2010 12:20:10 +0000 (12:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Oct 2010 12:20:10 +0000 (12:20 +0000)
        Reviewed by Xan Lopez.

        [GTK] Fix the build for GTK+ 3
        https://bugs.webkit.org/show_bug.cgi?id=47249

        Use GdkVisual instead of GdkColormap. GdkColormap has been removed
        in gtk3.

        * plugins/gtk/PluginViewGtk.cpp:
        (WebCore::PluginView::platformStart):
        * plugins/gtk/gtk2xtbin.c:
        (gtk_xtbin_new):
2010-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] Fix the build for GTK+ 3
        https://bugs.webkit.org/show_bug.cgi?id=47249

        Use GdkVisual instead of GdkColormap. GdkColormap has been removed
        in gtk3

        * webkit/webkitwebview.cpp:
        (webkit_web_view_realize):

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

WebCore/ChangeLog
WebCore/plugins/gtk/PluginViewGtk.cpp
WebCore/plugins/gtk/gtk2xtbin.c
WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitwebview.cpp

index 1a73edd..8bf55aa 100644 (file)
@@ -5,6 +5,21 @@
         [GTK] Fix the build for GTK+ 3
         https://bugs.webkit.org/show_bug.cgi?id=47249
 
+        Use GdkVisual instead of GdkColormap. GdkColormap has been removed
+        in gtk3.
+
+        * plugins/gtk/PluginViewGtk.cpp:
+        (WebCore::PluginView::platformStart):
+        * plugins/gtk/gtk2xtbin.c:
+        (gtk_xtbin_new):
+
+2010-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Fix the build for GTK+ 3
+        https://bugs.webkit.org/show_bug.cgi?id=47249
+
         Do not use GdkDrawable deprecated API. Some methods of GdkDrawable
         are deprecated in gtk2 and have been removed in gtk3. Equivalent
         API has been added to GdkWindow.
index bee7821..ef09729 100644 (file)
@@ -842,9 +842,9 @@ bool PluginView::platformStart()
             m_npWindow.window = (void*)gtk_socket_get_id(GTK_SOCKET(platformPluginWidget()));
             GdkWindow* window = gtk_widget_get_window(widget);
             ws->display = GDK_WINDOW_XDISPLAY(window);
-            ws->visual = GDK_VISUAL_XVISUAL(gdk_drawable_get_visual(GDK_DRAWABLE(window)));
-            ws->depth = gdk_visual_get_depth(gdk_drawable_get_visual(GDK_DRAWABLE(window)));
-            ws->colormap = GDK_COLORMAP_XCOLORMAP(gdk_drawable_get_colormap(GDK_DRAWABLE(window)));
+            ws->visual = GDK_VISUAL_XVISUAL(gdk_window_get_visual(window));
+            ws->depth = gdk_visual_get_depth(gdk_window_get_visual(window));
+            ws->colormap = XCreateColormap(ws->display, GDK_ROOT_WINDOW(), ws->visual, AllocNone);
         } else {
             m_npWindow.window = (void*)GTK_XTBIN(platformPluginWidget())->xtwindow;
             ws->display = GTK_XTBIN(platformPluginWidget())->xtdisplay;
index a0808d9..75c2b32 100644 (file)
@@ -326,8 +326,9 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
 {
   GtkXtBin *xtbin;
   gpointer user_data;
+  GdkScreen *screen;
   GdkVisual* visual;
-  GdkColormap* colormap;
+  Colormap colormap;
 
   assert(parent_window != NULL);
   xtbin = g_object_new (GTK_TYPE_XTBIN, NULL);
@@ -341,12 +342,15 @@ gtk_xtbin_new (GdkWindow *parent_window, String * f)
   /* Initialize the Xt toolkit */
   xtbin->parent_window = parent_window;
 
-  visual = gtk_widget_get_default_visual();
-  colormap = gtk_widget_get_default_colormap();
+  screen = gtk_widget_get_screen(GTK_WIDGET(parent_window));
+  visual = gdk_screen_get_system_visual(screen);
+  colormap = XCreateColormap(GDK_DISPLAY_XDISPLAY(gdk_screen_get_display(screen)),
+                             GDK_WINDOW_XWINDOW(gdk_screen_get_root_window(screen)),
+                             GDK_VISUAL_XVISUAL(visual), AllocNone);
 
   xt_client_init(&(xtbin->xtclient), 
                  GDK_VISUAL_XVISUAL(visual),
-                 GDK_COLORMAP_XCOLORMAP(colormap),
+                 colormap,
                  gdk_visual_get_depth(visual));
 
   if (!xtbin->xtclient.xtdisplay) {
index b1ef93f..2a1b7bf 100644 (file)
@@ -5,6 +5,19 @@
         [GTK] Fix the build for GTK+ 3
         https://bugs.webkit.org/show_bug.cgi?id=47249
 
+        Use GdkVisual instead of GdkColormap. GdkColormap has been removed
+        in gtk3
+
+        * webkit/webkitwebview.cpp:
+        (webkit_web_view_realize):
+
+2010-10-07  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Fix the build for GTK+ 3
+        https://bugs.webkit.org/show_bug.cgi?id=47249
+
         Do not use GdkDrawable deprecated API. Some methods of GdkDrawable
         are deprecated in gtk2 and have been removed in gtk3. Equivalent
         API has been added to GdkWindow.
index fb8006b..7c734f9 100644 (file)
@@ -848,7 +848,9 @@ static void webkit_web_view_realize(GtkWidget* widget)
     attributes.height = allocation.height;
     attributes.wclass = GDK_INPUT_OUTPUT;
     attributes.visual = gtk_widget_get_visual(widget);
+#ifdef GTK_API_VERSION_2
     attributes.colormap = gtk_widget_get_colormap(widget);
+#endif
     attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK
                             | GDK_EXPOSURE_MASK
                             | GDK_BUTTON_PRESS_MASK
@@ -861,7 +863,10 @@ static void webkit_web_view_realize(GtkWidget* widget)
                             | GDK_BUTTON2_MOTION_MASK
                             | GDK_BUTTON3_MOTION_MASK;
 
-    gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
+    gint attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+#ifdef GTK_API_VERSION_2
+    attributes_mask |= GDK_WA_COLORMAP;
+#endif
     GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributes_mask);
     gtk_widget_set_window(widget, window);
     gdk_window_set_user_data(window, widget);