Bug 62626

Summary: [GTK] Rename convertWidgetRectToScreenRect() to convertWidgetPointToScreenPoint()
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: gustavo, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 62627    
Attachments:
Description Flags
Patch mrobinson: review+

Description Carlos Garcia Campos 2011-06-14 02:13:57 PDT
This method actually translates coordinates, the rect size is never modified, so it should be renamed to convertWidgetPointToScreenPoint() and modified to return a point instead of a rectangle. I've also noticed that this functionality is duplicated in several places, so this method should be used instead. There's also a bug in the implementation, it translates the rectangle coordinates with gtk_widget_translate_coordinates(), and it moves the original rectangle using the translated coordinates as an offset instead of as final location, so the method is returning the wrong coordinates when the given rectangle is not at 0,0 (in ChromeClient::screenToWindow() the rect is always at 0,0 so I guess that's why we haven't noticed the bug before)
Comment 1 Carlos Garcia Campos 2011-06-14 02:24:15 PDT
Created attachment 97089 [details]
Patch
Comment 2 Martin Robinson 2011-06-14 07:53:34 PDT
Comment on attachment 97089 [details]
Patch

Nice!
Comment 3 Carlos Garcia Campos 2011-06-14 07:58:47 PDT
Committed r88802: <http://trac.webkit.org/changeset/88802>