[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

philn at webkit.org philn at webkit.org
Wed Dec 22 13:48:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3424b69c71f651b896c5a053834b210c05a30660
Author: philn at webkit.org <philn at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 17:50:31 2010 +0000

    2010-09-27  Philippe Normand  <pnormand at igalia.com>
    
            Reviewed by Martin Robinson.
    
            [GTK] Doesn't build with gtk+ 2.14
            https://bugs.webkit.org/show_bug.cgi?id=46565
    
            Fixed the build for GTK+ 2.14 by adding backward compatible
            a backward-compatible function for gtk_menu_item_get_label and a
            utility function to create a blank mouse cursor. Those functions
            are used in the fullscreen video controller and in the DRT
            EventSender.
    
            * platform/gtk/GtkVersioning.c:
            (gdk_window_get_root_coords):
            (blankCursor):
            (gtk_menu_item_get_label):
            * platform/gtk/GtkVersioning.h:
    
    WebKit/gtk:
    
            Reviewed by Martin Robinson.
    
            [GTK] Doesn't build with gtk+ 2.14
            https://bugs.webkit.org/show_bug.cgi?id=46565
    
            Fixed the build for GTK+ 2.14. Don't use gdk_window_get_cursor()
            for that GTK+ version as I found no acceptable way to work-around
            its absence.
    
            * WebCoreSupport/FullscreenVideoController.cpp:
            (FullscreenVideoController::showHud):
            (FullscreenVideoController::hideHud):
            (FullscreenVideoController::enterFullscreen):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68404 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3206772..b686a67 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-27  Philippe Normand  <pnormand at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Doesn't build with gtk+ 2.14
+        https://bugs.webkit.org/show_bug.cgi?id=46565
+
+        Fixed the build for GTK+ 2.14 by adding backward compatible
+        a backward-compatible function for gtk_menu_item_get_label and a
+        utility function to create a blank mouse cursor. Those functions
+        are used in the fullscreen video controller and in the DRT
+        EventSender.
+
+        * platform/gtk/GtkVersioning.c:
+        (gdk_window_get_root_coords):
+        (blankCursor):
+        (gtk_menu_item_get_label):
+        * platform/gtk/GtkVersioning.h:
+
 2010-09-23  Stephen White  <senorblanco at chromium.org>
 
         Reviewed by James Robinson.
diff --git a/WebCore/platform/gtk/GtkVersioning.c b/WebCore/platform/gtk/GtkVersioning.c
index 7dd601e..f5466be 100644
--- a/WebCore/platform/gtk/GtkVersioning.c
+++ b/WebCore/platform/gtk/GtkVersioning.c
@@ -60,10 +60,41 @@ GdkDevice *getDefaultGDKPointerDevice(GdkWindow* window)
 }
 
 #if !GTK_CHECK_VERSION(2, 17, 3)
-static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
+void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY)
 {
     gdk_window_get_root_origin(window, rootX, rootY);
     *rootX = *rootX + x;
     *rootY = *rootY + y;
 }
 #endif
+
+GdkCursor * blankCursor()
+{
+#if GTK_CHECK_VERSION(2, 16, 0)
+    return gdk_cursor_new(GDK_BLANK_CURSOR);
+#else
+    GdkCursor * cursor;
+    GdkPixmap * source;
+    GdkPixmap * mask;
+    GdkColor foreground = { 0, 65535, 0, 0 }; // Red.
+    GdkColor background = { 0, 0, 0, 65535 }; // Blue.
+    static gchar cursorBits[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
+
+    source = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+    mask = gdk_bitmap_create_from_data(0, cursorBits, 8, 8);
+    cursor = gdk_cursor_new_from_pixmap(source, mask, &foreground, &background, 8, 8);
+    gdk_pixmap_unref(source);
+    gdk_pixmap_unref(mask);
+    return cursor;
+#endif // GTK_CHECK_VERSION(2, 16, 0)
+}
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+const gchar* gtk_menu_item_get_label(GtkMenuItem* menuItem)
+{
+    GtkWidget * label = gtk_bin_get_child(GTK_BIN(menuItem));
+    if (GTK_IS_LABEL(label))
+        return gtk_label_get_text(GTK_LABEL(label));
+    return 0;
+}
+#endif // GTK_CHECK_VERSION(2, 16, 0)
diff --git a/WebCore/platform/gtk/GtkVersioning.h b/WebCore/platform/gtk/GtkVersioning.h
index 867e14f..a874e9e 100644
--- a/WebCore/platform/gtk/GtkVersioning.h
+++ b/WebCore/platform/gtk/GtkVersioning.h
@@ -57,6 +57,8 @@ G_BEGIN_DECLS
 
 #if !GTK_CHECK_VERSION(2, 18, 0)
 #define gtk_widget_set_visible(widget, FALSE) GTK_WIDGET_UNSET_FLAGS((widget), GTK_VISIBLE)
+#define gtk_widget_get_visible(widget) (GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE)
+
 #define gtk_widget_set_window(widget, new_window) (widget)->window = (new_window)
 #define gtk_widget_set_can_focus(widget, TRUE) GTK_WIDGET_SET_FLAGS((widget), GTK_CAN_FOCUS)
 #define gtk_widget_get_allocation(widget, alloc) (*(alloc) = (widget)->allocation)
@@ -64,8 +66,13 @@ G_BEGIN_DECLS
 #endif // GTK_CHECK_VERSION(2, 18, 0)
 
 #if !GTK_CHECK_VERSION(2, 17, 3)
-static void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);
-#endif //GTK_CHECK_VERSION(2, 17, 3)
+void gdk_window_get_root_coords(GdkWindow* window, gint x, gint y, gint* rootX, gint* rootY);
+#endif // GTK_CHECK_VERSION(2, 17, 3)
+
+#if !GTK_CHECK_VERSION(2, 16, 0)
+const gchar* gtk_menu_item_get_label(GtkMenuItem*);
+#endif // GTK_CHECK_VERSION(2, 16, 0)
+
 
 #if !GTK_CHECK_VERSION(2, 14, 0)
 #define gtk_widget_get_window(widget) (widget)->window
@@ -84,6 +91,7 @@ void gtk_adjustment_set_value(GtkAdjustment* adjusment, gdouble value);
 #endif // GTK_CHECK_VERSION(2, 14, 0)
 
 GdkDevice* getDefaultGDKPointerDevice(GdkWindow* window);
+GdkCursor* blankCursor();
 
 G_END_DECLS
 
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index e0c32b8..1ea6827 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,19 @@
+2010-09-27  Philippe Normand  <pnormand at igalia.com>
+
+        Reviewed by Martin Robinson.
+
+        [GTK] Doesn't build with gtk+ 2.14
+        https://bugs.webkit.org/show_bug.cgi?id=46565
+
+        Fixed the build for GTK+ 2.14. Don't use gdk_window_get_cursor()
+        for that GTK+ version as I found no acceptable way to work-around
+        its absence.
+
+        * WebCoreSupport/FullscreenVideoController.cpp:
+        (FullscreenVideoController::showHud):
+        (FullscreenVideoController::hideHud):
+        (FullscreenVideoController::enterFullscreen):
+
 2010-09-26  Jenn Braithwaite  <jennb at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
index cf9a548..01bc03a 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.cpp
@@ -175,7 +175,7 @@ void FullscreenVideoController::showHud(bool autoHide)
 
     // Show the cursor.
     GdkWindow* window = gtk_widget_get_window(m_window);
-    gdk_window_set_cursor(window, m_cursor.get());
+    gdk_window_set_cursor(window, 0);
 
     // Update the progress bar immediately before showing the window.
     updateHudProgressBar();
@@ -210,7 +210,7 @@ void FullscreenVideoController::hideHud()
     }
 
     GdkWindow* window = gtk_widget_get_window(m_window);
-    GdkCursor* cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
+    GdkCursor* cursor = blankCursor();
     gdk_window_set_cursor(window, cursor);
 
     gtk_widget_hide_all(m_hudWindow);
@@ -283,8 +283,7 @@ void FullscreenVideoController::enterFullscreen()
     gtk_widget_show_all(m_window);
 
     GdkWindow* window = gtk_widget_get_window(m_window);
-    GdkCursor* cursor = gdk_cursor_new(GDK_BLANK_CURSOR);
-    m_cursor = gdk_window_get_cursor(window);
+    GdkCursor* cursor = blankCursor();
     gdk_window_set_cursor(window, cursor);
     gdk_cursor_unref(cursor);
 
diff --git a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
index 9ff1e6a..d4bbea2 100644
--- a/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
+++ b/WebKit/gtk/WebCoreSupport/FullscreenVideoController.h
@@ -82,7 +82,6 @@ private:
     guint m_volumeUpdateId;
     bool m_seekLock;
     GtkWidget* m_window;
-    PlatformRefPtr<GdkCursor> m_cursor;
     GtkWidget* m_hudWindow;
     GtkAction* m_playPauseAction;
     GtkAction* m_exitFullscreenAction;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list