Bug 108376

Summary: [Gtk] drag and drop has black background without composition
Product: WebKit Reporter: arno. <a.renevier>
Component: WebKitGTKAssignee: arno. <a.renevier>
Status: RESOLVED FIXED    
Severity: Normal CC: mrobinson, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch proposal
none
updated patch: no need for a ManualTest
none
updated patch to address reviewer comments none

arno.
Reported 2013-01-30 14:01:38 PST
Hi, when dragging some text, a popup window with 0 opacity is created. It is then set as the drag icon with gtk_drag_set_icon_widget. While this gives a nice transparent result an a desktop with a compositor, it gives a black background when there is not compositor. So, if the text is black, it is not readable. And if the text is white, it's ugly anyway. May be we could use gtk_drag_set_icon_pixbuf as mozilla does (or gtk_drag_set_icon_surface when available to avoid a cairo/pixbuf conversion). This api decompose image into transparent/non transparent rectangles and use Xshape to make the transparent rectangles actually transparent even without a compositor.
Attachments
patch proposal (6.47 KB, patch)
2013-01-30 14:21 PST, arno.
no flags
updated patch: no need for a ManualTest (5.36 KB, patch)
2013-01-30 16:19 PST, arno.
no flags
updated patch to address reviewer comments (5.31 KB, patch)
2013-01-30 18:10 PST, arno.
no flags
arno.
Comment 1 2013-01-30 14:21:54 PST
Created attachment 185571 [details] patch proposal
Martin Robinson
Comment 2 2013-01-30 15:49:51 PST
If we are falling back, maybe we should just fall back all the way to a simple icon? Maybe you can show me what the fallback looks like.
arno.
Comment 3 2013-01-30 16:19:14 PST
Created attachment 185612 [details] updated patch: no need for a ManualTest
Martin Robinson
Comment 4 2013-01-30 16:48:20 PST
Comment on attachment 185612 [details] updated patch: no need for a ManualTest View in context: https://bugs.webkit.org/attachment.cgi?id=185612&action=review Looks great, just needs a teensy bit of cleaning up. > Source/WebCore/platform/gtk/DragIcon.cpp:56 > +#ifdef GTK_API_VERSION_2 > + , m_pixbuf(0) > +#endif This can be eliminated with a GRefPtr. See below. > Source/WebCore/platform/gtk/DragIcon.cpp:89 > +#ifdef GTK_API_VERSION_2 > + if (m_pixbuf) > + g_object_unref(m_pixbuf); > +#endif Instead of a raw pointer you could use a GRefPtr here. > Source/WebCore/platform/gtk/DragIcon.cpp:116 > +#ifdef GTK_API_VERSION_2 > + if (m_pixbuf) > + g_object_unref(m_pixbuf); > + m_pixbuf = cairoImageSurfaceToGdkPixbuf(image); > +#endif This would become: m_pixbuf = adoptGRef(cairoImageSurfaceToGdkPixbuf(image)); > Source/WebCore/platform/gtk/DragIcon.h:45 > + gboolean m_iscomposited; This should probably be: bool isComposited;
arno.
Comment 5 2013-01-30 18:10:00 PST
Created attachment 185642 [details] updated patch to address reviewer comments
Martin Robinson
Comment 6 2013-01-31 08:46:16 PST
Comment on attachment 185642 [details] updated patch to address reviewer comments Great!
WebKit Review Bot
Comment 7 2013-01-31 15:47:36 PST
Comment on attachment 185642 [details] updated patch to address reviewer comments Clearing flags on attachment: 185642 Committed r141498: <http://trac.webkit.org/changeset/141498>
WebKit Review Bot
Comment 8 2013-01-31 15:47:39 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.