Bug 143217 - [GTK] DnD icon/widget has odd background
Summary: [GTK] DnD icon/widget has odd background
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2015-03-30 05:26 PDT by Carlos Garnacho
Modified: 2015-03-31 00:50 PDT (History)
5 users (show)

See Also:


Attachments
Patch (11.30 KB, patch)
2015-03-30 06:24 PDT, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garnacho 2015-03-30 05:26:24 PDT
If you DnD anything, the DnD icon shows an odd background. During the weekend I found out that WebKitGtk is using gtk_drag_set_icon_widget(), but is not setting the passed GtkWindow widget as app-paintable, which forces background rendering that would be unintended here.

After some chatting with KaL on #gtk+, it seems like a better approach though is using gtk_drag_set_icon_surface():

  KaL     garnacho_: we should probably use gtk_drag_set_icon_surface
          I don't know why we use a widget for that, TBH
          since the drag icon is rendered into a cairo surface in webcore

Doing either would fix the odd background on DnD icons.
Comment 1 Carlos Garcia Campos 2015-03-30 05:58:47 PDT
We can just remove DragIcon entirely, and use simply gtk_drag_set_icon_surface().
Comment 2 Carlos Garcia Campos 2015-03-30 06:24:18 PDT
Created attachment 249726 [details]
Patch
Comment 3 Martin Robinson 2015-03-30 08:07:25 PDT
Comment on attachment 249726 [details]
Patch

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

> Source/WebCore/ChangeLog:10
> +        Remove DragIcon class since it's no longer needed with GTK+3 and
> +        the GTK+2 code there is unused.
> +

It's great that GTK+ improved the API here. Do you mind explaining a bit more here why this is no longer necessary for GTK+3? What changes allow us to work properly with composited window managers without a window?
Comment 4 Carlos Garcia Campos 2015-03-30 08:26:30 PDT
(In reply to comment #3)
> Comment on attachment 249726 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=249726&action=review
> 
> > Source/WebCore/ChangeLog:10
> > +        Remove DragIcon class since it's no longer needed with GTK+3 and
> > +        the GTK+2 code there is unused.
> > +
> 
> It's great that GTK+ improved the API here. Do you mind explaining a bit
> more here why this is no longer necessary for GTK+3? What changes allow us
> to work properly with composited window managers without a window?

GTK+ knows what to do with a cairo surface, I guess we migrated the gtk+2 code to gtk+3 without realizing that using the surface was enough.
Comment 5 Martin Robinson 2015-03-30 08:30:48 PDT
Comment on attachment 249726 [details]
Patch

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

>>> Source/WebCore/ChangeLog:10
>>> +
>> 
>> It's great that GTK+ improved the API here. Do you mind explaining a bit more here why this is no longer necessary for GTK+3? What changes allow us to work properly with composited window managers without a window?
> 
> GTK+ knows what to do with a cairo surface, I guess we migrated the gtk+2 code to gtk+3 without realizing that using the surface was enough.

Cool, do you mind just dropping something like that into the ChangeLog?
Comment 6 Carlos Garcia Campos 2015-03-31 00:50:49 PDT
Committed r182175: <http://trac.webkit.org/changeset/182175>