Bug 55960

Summary: [GTK] [WebKit2] WebView::windowToScreen needs an implementation
Product: WebKit Reporter: Martin Robinson <mrobinson>
Component: WebKitGTKAssignee: Martin Robinson <mrobinson>
Status: RESOLVED FIXED    
Severity: Normal Keywords: Gtk
Priority: P3    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
Patch
none
Patch using duplicating calculating from WebKit1
none
Patch none

Description Martin Robinson 2011-03-08 12:28:39 PST
WebView::windowToScreen was added to PageClientImpl in r80569.
Comment 1 Martin Robinson 2011-03-08 12:32:53 PST
Created attachment 85080 [details]
Patch
Comment 2 Martin Robinson 2011-03-09 13:16:50 PST
Created attachment 85222 [details]
Patch using duplicating calculating from WebKit1
Comment 3 Carlos Garcia Campos 2011-04-01 07:59:32 PDT
Comment on attachment 85222 [details]
Patch using duplicating calculating from WebKit1

View in context: https://bugs.webkit.org/attachment.cgi?id=85222&action=review

> Source/WebKit2/UIProcess/gtk/WebView.cpp:243
> +    GtkWidget* toplevel = gtk_widget_get_toplevel(m_viewWidget);
> +    if (!toplevel || !gtk_widget_is_toplevel(toplevel) || !GTK_IS_WINDOW(toplevel))
> +        return rect;
> +
> +    int xInWindow, yInWindow;
> +    gtk_widget_translate_coordinates(m_viewWidget, toplevel, rect.x(), rect.y(), &xInWindow, &yInWindow);
> +    int windowOriginX, windowOriginY;
> +    gdk_window_get_origin(gtk_widget_get_window(toplevel), &windowOriginX, &windowOriginY);
> +
> +    IntRect rectInScreenCoordinates(rect);
> +    rectInScreenCoordinates.move(windowOriginX + xInWindow, windowOriginY + yInWindow);
> +    return rectInScreenCoordinates;

hmm, isn't all this the same than simply calling gdk_window_get_origin(gtk_widget_get_window(m_viewWidget), &x, &y); ?
Comment 4 Martin Robinson 2011-04-04 15:07:27 PDT
(In reply to comment #3)
> hmm, isn't all this the same than simply calling gdk_window_get_origin(gtk_widget_get_window(m_viewWidget), &x, &y); ?

Carlos and I talked about this before and I explained how a more complex implementation is likely necessary because widgets can share GdkWindows.
Comment 5 Xan Lopez 2011-04-26 15:59:28 PDT
Comment on attachment 85222 [details]
Patch using duplicating calculating from WebKit1

IIRC this is very similar to the code in WebKit1? Wasn't the plan to move it into WebCore somehow and share it? r- for now!
Comment 6 Martin Robinson 2011-05-02 17:06:07 PDT
Created attachment 92009 [details]
Patch
Comment 7 Xan Lopez 2011-05-05 17:01:54 PDT
Comment on attachment 92009 [details]
Patch

Alright.
Comment 8 Martin Robinson 2011-05-06 16:29:54 PDT
Comment on attachment 92009 [details]
Patch

Clearing flags on attachment: 92009

Committed r85987: <http://trac.webkit.org/changeset/85987>
Comment 9 Martin Robinson 2011-05-06 16:29:57 PDT
All reviewed patches have been landed.  Closing bug.