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 641975 - Pre-_NET_WM_ICONs look corrupted
Pre-_NET_WM_ICONs look corrupted
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-09 22:53 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-03-21 23:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot (19.63 KB, image/png)
2011-02-09 22:59 UTC, Jasper St. Pierre (not reading bugmail)
  Details
iconcache: Fix apply_mask (1.48 KB, patch)
2011-02-28 08:47 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
iconcache: Fix apply_mask (1.17 KB, patch)
2011-02-28 08:48 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Correctly interpret monochrome icons (2.37 KB, patch)
2011-03-21 22:47 UTC, Owen Taylor
committed Details | Review
iconcache: don't crash on a non-alpha mask pixmap (1.24 KB, patch)
2011-03-21 22:51 UTC, Owen Taylor
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-02-09 22:53:00 UTC
see attached screenshot
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-02-09 22:59:35 UTC
Created attachment 180530 [details]
screenshot

<owen> magcius: the handling for the old pre-net-wm-spec icons seems to be broken
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-02-28 07:25:22 UTC
The current release of SDL uses X pixmaps instead of using _NET_WM_ICON. It looks like they've implemented it in a development version, though.
Comment 3 Jasper St. Pierre (not reading bugmail) 2011-02-28 08:47:08 UTC
Created attachment 182068 [details] [review]
iconcache: Fix apply_mask

apply_mask made some wrong assumptions that became untrue
after rendering_cleanup landed, such as the number of channels
in the pixmap, causing corruption.
Comment 4 Jasper St. Pierre (not reading bugmail) 2011-02-28 08:48:56 UTC
Created attachment 182070 [details] [review]
iconcache: Fix apply_mask

apply_mask made some wrong assumptions that became untrue
after rendering_cleanup landed, such as the number of channels
in the pixmap, causing corruption.



Removed stray debugging code.
Comment 5 Owen Taylor 2011-03-21 22:47:42 UTC
Created attachment 184018 [details] [review]
Correctly interpret monochrome icons

Testing with xeyes, I needed this to get the right results
with your patch.

Getting the contents of a depth-1 pixmap through cairo gives us
an alpha pixmap. We need to convert to a monochrome pixmap
as is expected by the ICCCM definition of WM_HINTS.
Comment 6 Owen Taylor 2011-03-21 22:51:19 UTC
Created attachment 184019 [details] [review]
iconcache: don't crash on a non-alpha mask pixmap

We assume when applying a mask that it is a depth-1 pixmap that
cairo interprets as alpha. So ignore a non-depth-1 mask.
Comment 7 Owen Taylor 2011-03-21 22:52:35 UTC
Review of attachment 182070 [details] [review]:

Mostly looks good, it looks to me like meta_gdk_pixbuf_get_from_pixmap() might return a 3-channel pixmap if given a source pixmap of depth != 1, so we need to validate the depth of the mask. Attached a patch to do that.
Comment 8 Owen Taylor 2011-03-21 23:09:52 UTC
Attachment 182070 [details] pushed as 92663c8 - iconcache: Fix apply_mask
Attachment 184019 [details] pushed as 82db52a - iconcache: don't crash on a non-alpha mask pixmap
Comment 9 Owen Taylor 2011-03-21 23:10:25 UTC
Review of attachment 184018 [details] [review]:

Pushed as well
Comment 10 Owen Taylor 2011-03-21 23:10:52 UTC
IRC reviewed and pushed