[Webkit-unassigned] [Bug 63256] [GTK] Fix runtime critical warnings in WebKit2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 23 08:21:14 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63256





--- Comment #3 from Carlos Garcia Campos <cgarcia at igalia.com>  2011-06-23 08:21:15 PST ---
(In reply to comment #2)
> (From update of attachment 98350 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=98350&action=review
> 
> > Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:92
> > -FloatRect screenRect(Widget* widget)
> > +static gboolean getScreenAndMonitorForWidget(Widget* widget, GdkScreen** screenOut, gint* monitorOut)
> 
> I'd rather this be a smaller helper (getScreen) like getVisual. In fact, getVisual should just use this helper to get the screen.

You mean the name? or that we only return the screen and not the monitor?

> > Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:127
> > +    if (!widget)
> > +        return FloatRect();
> > +
> > +    GdkScreen* screen;
> > +    gint monitor;
> > +    if (!getScreenAndMonitorForWidget(widget, &screen, &monitor))
> >          return FloatRect();
> >  
> > -    gint monitor = gdk_screen_get_monitor_at_window(screen, gtk_widget_get_window(GTK_WIDGET(container)));
> >      GdkRectangle geometry;
> >      gdk_screen_get_monitor_geometry(screen, monitor, &geometry);
> > -    
> > +
> 
> I think this could be a bit more straightforward. The use of out-parameters is a bit cludgy here. Why not just maintain the structure of screenRect and then do an early return if getScreenForWidget/getScreen fails?

I'm not sure I get it, that's what it does, it returns early when getScreenAndMonitorForWidget() fails.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list