After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 439417 - "glow" doesn't work with alpha
"glow" doesn't work with alpha
Status: RESOLVED FIXED
Product: libwnck
Classification: Core
Component: tasklist
unspecified
Other Linux
: Normal normal
: ---
Assigned To: libwnck maintainers
libwnck maintainers
Depends on:
Blocks:
 
 
Reported: 2007-05-18 13:36 UTC by Allison Karlitskaya (desrt)
Modified: 2007-06-20 22:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of the badness (18.44 KB, image/png)
2007-05-18 13:40 UTC, Allison Karlitskaya (desrt)
  Details
First try (2.34 KB, patch)
2007-06-20 15:56 UTC, Vincent Untz
none Details | Review
implement glowing using cairo - first try (7.06 KB, patch)
2007-06-20 21:16 UTC, Allison Karlitskaya (desrt)
committed Details | Review
the effect with the patch (26.97 KB, image/png)
2007-06-20 21:17 UTC, Allison Karlitskaya (desrt)
  Details
the changes (2.58 KB, patch)
2007-06-20 22:21 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Allison Karlitskaya (desrt) 2007-05-18 13:36:10 UTC
if you put a wncktasklist inside of a window with an rgba background then wnck_task_button_glow () doesn't work properly.

it copies only the r/g/b channel of the button which, in the case of a fully-alpha background, is just black.

this could probably be done properly with cairo functions instead of gdk_pixbuf ones.  you'd gain the advantage that the compositing is done server-side and possibly with the help of hardware.
Comment 1 Allison Karlitskaya (desrt) 2007-05-18 13:40:03 UTC
Created attachment 88388 [details]
screenshot of the badness
Comment 2 Vincent Untz 2007-06-20 15:56:57 UTC
Created attachment 90343 [details] [review]
First try

Does this help? I don't this part of the code well, so I'm not sure that's enough.

(patch is mixed with the patch for bug 412887, but it doesn't matter)
Comment 3 Vincent Untz 2007-06-20 15:57:27 UTC
Also, I'd love to do this in cairo, but my cairo-fu is... well... you know what I mean :-)
Comment 4 Havoc Pennington 2007-06-20 16:12:30 UTC
The gdk_rectangle_intersect() is not equivalent to the code that was there before, though I don't remember why what was there before was like it was.

I doubt the patch makes any difference - this may require a fix to get_from_drawable such that it copies the alpha channel (or copies the composited result from the screen? I don't know how this would be done)

I'd suggest asking one of the people who knows a lot about the new X features (RGBA, composite)

I'm not sure Cairo is helpful, since the issue here is taking the screenshot (afaik cairo doesn't do that)
Comment 5 Allison Karlitskaya (desrt) 2007-06-20 16:15:36 UTC
my suggestion was to avoid taking the screenshot at all.  cairo probably has the appropriate support for performing the image transformation server-side.
Comment 6 Allison Karlitskaya (desrt) 2007-06-20 21:16:24 UTC
Created attachment 90367 [details] [review]
implement glowing using cairo - first try

here's a patch to implement the glow using cairo.

i've also included a -t (--transparent) option to the test-tasklist program so you can try it out.
Comment 7 Allison Karlitskaya (desrt) 2007-06-20 21:17:05 UTC
Created attachment 90368 [details]
the effect with the patch
Comment 8 Vincent Untz 2007-06-20 22:10:21 UTC
Thanks Ryan! I didn't commit the test-tasklist part. Feel free to update this part of the patch (detect if there's a compositing manager, and don't make it 100% transparent ;-))

Havoc: the gdk_rectangle_intersect() change was an attempt to fix bug 412887, but it doesn't fix it.
Comment 9 Allison Karlitskaya (desrt) 2007-06-20 22:21:27 UTC
Created attachment 90373 [details] [review]
the changes

now 50% transparent (white background)

if COMPOSITE extension is missing or a compositing manager is not present then we just set the relief type to none but don't actually make the window transparent.

cheers.
Comment 10 Vincent Untz 2007-06-20 22:29:27 UTC
Thanks!