Changeset 49921 in webkit


Ignore:
Timestamp:
Oct 21, 2009 1:47:21 PM (15 years ago)
Author:
eric@webkit.org
Message:

2009-10-21 Alejandro G. Castro <alex@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:
Location:
trunk/WebKitTools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r49915 r49921  
     12009-10-21  Alejandro G. Castro  <alex@igalia.com>
     2
     3        Reviewed by Gustavo Noronha.
     4
     5        [GTK] Added conditional code to avoid using
     6        gdk_window_get_root_coords if we do not have a gtk+ release newer
     7        than 2.17.3.
     8        https://bugs.webkit.org/show_bug.cgi?id=30636
     9
     10        * WebKitTools/DumpRenderTree/gtk/EventSender.cpp:
     11
    1122009-10-21  Shu Chang  <Chang.Shu@nokia.com>
    213
  • trunk/WebKitTools/DumpRenderTree/gtk/EventSender.cpp

    r49913 r49921  
    130130}
    131131
     132#if !GTK_CHECK_VERSION(2,17,3)
     133static void getRootCoords(GtkWidget* view, int* rootX, int* rootY)
     134{
     135    GtkWidget* window = gtk_widget_get_toplevel(GTK_WIDGET(view));
     136    int tmpX, tmpY;
     137
     138    gtk_widget_translate_coordinates(view, window, lastMousePositionX, lastMousePositionY, &tmpX, &tmpY);
     139
     140    gdk_window_get_origin(window->window, rootX, rootY);
     141
     142    *rootX += tmpX;
     143    *rootY += tmpY;
     144}
     145#endif
     146
    132147static JSValueRef mouseDownCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
    133148{
     
    157172
    158173    int x_root, y_root;
     174#if GTK_CHECK_VERSION(2,17,3)
    159175    gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
     176#else
     177    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
     178#endif
    160179
    161180    event.button.x_root = x_root;
     
    210229
    211230    int x_root, y_root;
     231#if GTK_CHECK_VERSION(2,17,3)
    212232    gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
     233#else
     234    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
     235#endif
    213236
    214237    event.button.x_root = x_root;
     
    256279
    257280    int x_root, y_root;
     281#if GTK_CHECK_VERSION(2,17,3)
    258282    gdk_window_get_root_coords(GTK_WIDGET(view)->window, lastMousePositionX, lastMousePositionY, &x_root, &y_root);
     283#else
     284    getRootCoords(GTK_WIDGET(view), &x_root, &y_root);
     285#endif
    259286
    260287    event.motion.x_root = x_root;
Note: See TracChangeset for help on using the changeset viewer.