[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

eric at webkit.org eric at webkit.org
Thu Oct 29 20:49:45 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 9fad4aa3d9cc0921f0cbbce5b0476979f11e4ad9
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 21 20:47:21 2009 +0000

    2009-10-21  Alejandro G. Castro  <alex at igalia.com>
    
            Reviewed by Gustavo Noronha.
    
            [GTK] Added conditional code to avoid using
            gdk_window_get_root_coords if we do not have a gtk+ release newer
            than 2.17.3.
            https://bugs.webkit.org/show_bug.cgi?id=30636
    
            * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49921 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 1a0d34e..ba2aaa0 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,14 @@
+2009-10-21  Alejandro G. Castro  <alex at igalia.com>
+
+        Reviewed by Gustavo Noronha.
+
+        [GTK] Added conditional code to avoid using
+        gdk_window_get_root_coords if we do not have a gtk+ release newer
+        than 2.17.3.
+        https://bugs.webkit.org/show_bug.cgi?id=30636
+
+        * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
+
 2009-10-21  Shu Chang  <Chang.Shu at nokia.com>
 
         Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
index b456704..f42928c 100644
--- a/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/EventSender.cpp
@@ -129,6 +129,21 @@ static void updateClickCount(int /* button */)
         clickCount++;
 }
 
+#if !GTK_CHECK_VERSION(2,17,3)
+static void getRootCoords(GtkWidget* view, int* rootX, int* rootY)
+{
+    GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
+    int tmpX, tmpY;
+
+    gtk_widget_translate_coordinates(view, window, lastMousePositionX, lastMousePositionY, &tmpX, &tmpY);
+
+    gdk_window_get_origin(window->window, rootX, rootY);
+
+    *rootX += tmpX;
+    *rootY += tmpY;
+}
+#endif
+
 static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     WebKitWebView* view = webkit_web_frame_get_web_view(mainFrame);
@@ -156,7 +171,11 @@ static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function,
     event.button.device = gdk_device_get_core_pointer();
 
     int x_root, y_root;
+#if GTK_CHECK_VERSION(2,17,3)
     gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
+#else
+    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
+#endif
 
     event.button.x_root = x_root;
     event.button.y_root = y_root;
@@ -209,7 +228,11 @@ static JSValueRef mouseUpCallback(JSContextRef context, JSObjectRef function, JS
     event.button.device = gdk_device_get_core_pointer();
 
     int x_root, y_root;
+#if GTK_CHECK_VERSION(2,17,3)
     gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
+#else
+    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
+#endif
 
     event.button.x_root = x_root;
     event.button.y_root = y_root;
@@ -255,7 +278,11 @@ static JSValueRef mouseMoveToCallback(JSContextRef context, JSObjectRef function
     event.motion.device = gdk_device_get_core_pointer();
 
     int x_root, y_root;
+#if GTK_CHECK_VERSION(2,17,3)
     gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
+#else
+    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
+#endif
 
     event.motion.x_root = x_root;
     event.motion.y_root = y_root;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list