Changeset 85987 in webkit
- Timestamp:
- May 6, 2011 4:29:43 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r85985 r85987 1 2011-05-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] [WebKit2] WebView::windowToScreen needs an implementation 6 https://bugs.webkit.org/show_bug.cgi?id=55960 7 8 Abstract coordinate system translation code from WebKit into WebCore. 9 This will allow the code to be shared between WebKit and WebKit2. The code 10 now lives in a new GtkUtilities.cpp helper file. 11 12 * GNUmakefile.list.am: Added GtkUtilities to the source list. 13 * platform/gtk/GtkUtilities.cpp: Added. 14 (WebCore::convertWidgetRectToScreenRect): 15 * platform/gtk/GtkUtilities.h: Added. 16 1 17 2011-05-06 Martin Robinson <mrobinson@igalia.com> 2 18 -
trunk/Source/WebCore/GNUmakefile.list.am
r85909 r85987 3735 3735 Source/WebCore/platform/gtk/GtkClickCounter.cpp \ 3736 3736 Source/WebCore/platform/gtk/GtkClickCounter.h \ 3737 Source/WebCore/platform/gtk/GtkUtilities.cpp \ 3738 Source/WebCore/platform/gtk/GtkUtilities.h \ 3737 3739 Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp \ 3738 3740 Source/WebCore/platform/gtk/GeolocationServiceGtk.h \ -
trunk/Source/WebKit/gtk/ChangeLog
r85925 r85987 1 2011-05-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] [WebKit2] WebView::windowToScreen needs an implementation 6 https://bugs.webkit.org/show_bug.cgi?id=55960 7 8 Abstract the code to translate from widget space to screen space into 9 a helper method in WebCore. 10 11 * WebCoreSupport/ChromeClientGtk.cpp: Use the new helper method from GtkUtilities. 12 (WebKit::ChromeClient::windowToScreen): 13 (WebKit::ChromeClient::screenToWindow): 14 1 15 2011-05-04 Philippe Normand <pnormand@igalia.com> 2 16 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r85066 r85987 34 34 #include "FrameLoadRequest.h" 35 35 #include "FrameView.h" 36 #include "GtkUtilities.h" 36 37 #include "GtkVersioning.h" 37 38 #include "HTMLNames.h" … … 451 452 } 452 453 453 // FIXME: this does not take into account the WM decorations454 static IntPoint widgetScreenPosition(GtkWidget* widget)455 {456 GtkWidget* window = gtk_widget_get_toplevel(widget);457 int widgetX = 0, widgetY = 0;458 459 gtk_widget_translate_coordinates(widget, window, 0, 0, &widgetX, &widgetY);460 461 IntPoint result(widgetX, widgetY);462 int originX, originY;463 gdk_window_get_origin(gtk_widget_get_window(window), &originX, &originY);464 result.move(originX, originY);465 466 return result;467 }468 469 454 IntRect ChromeClient::windowToScreen(const IntRect& rect) const 470 455 { 471 IntRect result(rect); 472 IntPoint screenPosition = widgetScreenPosition(GTK_WIDGET(m_webView)); 473 result.move(screenPosition.x(), screenPosition.y()); 474 475 return result; 456 return convertWidgetRectToScreenRect(GTK_WIDGET(m_webView), rect); 476 457 } 477 458 478 459 IntPoint ChromeClient::screenToWindow(const IntPoint& point) const 479 460 { 461 IntPoint widgetPositionOnScreen = convertWidgetRectToScreenRect(GTK_WIDGET(m_webView), 462 IntRect(IntPoint(), IntSize())).location(); 480 463 IntPoint result(point); 481 IntPoint screenPosition = widgetScreenPosition(GTK_WIDGET(m_webView)); 482 result.move(-screenPosition.x(), -screenPosition.y()); 483 464 result.move(-widgetPositionOnScreen.x(), -widgetPositionOnScreen.y()); 484 465 return result; 485 466 } -
trunk/Source/WebKit2/ChangeLog
r85983 r85987 1 2011-05-06 Martin Robinson <mrobinson@igalia.com> 2 3 Reviewed by Xan Lopez. 4 5 [GTK] [WebKit2] WebView::windowToScreen needs an implementation 6 https://bugs.webkit.org/show_bug.cgi?id=55960 7 8 Add an implementation of PageClient::windowToScreen for GTK+ WebKit2 using 9 the newly abstracted widget to screen coordinate translation code in WebCore. 10 11 * UIProcess/API/gtk/PageClientImpl.cpp: 12 (WebKit::PageClientImpl::windowToScreen): Added implementation. 13 1 14 2011-05-06 Anders Carlsson <andersca@apple.com> 2 15 -
trunk/Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
r85860 r85987 38 38 #include "WebKitWebViewBasePrivate.h" 39 39 #include "WebPageProxy.h" 40 #include <WebCore/GtkUtilities.h> 40 41 #include <wtf/text/WTFString.h> 41 42 … … 413 414 IntRect PageClientImpl::windowToScreen(const IntRect& rect) 414 415 { 415 notImplemented(); 416 return IntRect(); 416 return convertWidgetRectToScreenRect(m_viewWidget, rect); 417 417 } 418 418
Note: See TracChangeset
for help on using the changeset viewer.