#880 Icons not displayed correctly

appearance
open
nobody
icewm-1.3 (100)
5
2011-08-18
2011-08-18
Marcus Moeller
No

I have upgraded my IceWM Installation to 1.3.7-1 (Debian package version) and noticed that some icons of applications like nautilus or gnome-terminal are not displayed correctly anymore (unknown application icon is shown, instead). They have been displayed correctly in the previous version (which was 1.3.7~pre2-1+b1).

I have also re-checked if it's an IceWM problem by using another panel (in this case tint2), where the icons are shown correctly.

Discussion

  • This is introduced in revision 1.27.2.11.2.14 by captnmark, Sun Oct 17 17:38:56 2010 UTC of wmclient.cc.

    Unfortunately, this change was not done exactly in the same way I proposed in https://sourceforge.net/mailarchive/message.php?msg_id=25125642 . Namelly, in the current code the icon property is not read in full because of the redundant check "bytes_remain == 0" in the while() loop. Also, the current code still imposes the unneeded artificial limit for the icon size.

    Can you please check that with the attached patch the icons are displayed correctly?

     
  • It seems it is impossible to attach a file to a comment, therefore, here it goes inline. Copy and paste it to a file and apply with "patch -p1 < saved_patch_file"

    Index: icewm-1.3.7/src/wmclient.cc

    --- icewm-1.3.7.orig/src/wmclient.cc 2010-10-31 17:09:36.000000000 +0300
    +++ icewm-1.3.7/src/wmclient.cc 2011-08-18 13:24:28.666429265 +0400
    @@ -1044,20 +1044,11 @@
    while (XGetWindowProperty(display, handle,
    propAtom, (itemCount * itemSize) / 32, 1024*32, False, AnyPropertyType,
    &r_type, &r_format, &nitems, &bytes_remain,
    - &prop) == Success && prop && bytes_remain == 0)
    + &prop) == Success && prop)
    {
    if (r_format == itemSize1 && nitems > 0) {
    data = realloc(data, (itemCount + nitems) * itemSize / 8);

    - // access to memory beyound 256MiB causes crashes! But anyhow, size
    - // >>2MiB looks suspicious. Detect this case ASAP. However, if
    - // the usable icon is somewhere in the beginning, it's okay to
    - // return truncated data.
    - if (itemCount * itemSize / 8 >= 2097152) {
    - XFree(prop);
    - break;
    - }
    -
    memcpy((char *)data + itemCount * itemSize / 8, prop, nitems * itemSize / 8);
    itemCount += nitems;
    XFree(prop);

     
  • Oh, f**k, the formatting in the comments is completely broken.

    God, please, make the person who developed this new sourceforge webinterface die a painful death! Amen.

     
  • See patch #3393827 "Fix reading window icon property".

     
  • Marcus Moeller
    Marcus Moeller
    2011-11-15

    At least the icons of gtk3 applications are not displayed correctly.

    The rest works again (icewm-1.2.37-7)

     
  • Marcus Moeller
    Marcus Moeller
    2012-05-27

    Yes, the attached patch works fine. Could you please include it in the next release?

     
  • Eduard Bloch
    Eduard Bloch
    2012-05-27

    Hello Stanislav,

    thanks for providing this modification. I planed to change it in 1.3.7-3 in Debian but it was somehow lost in transition. I guess I will make an update of the Debian package with this change as soon as 1.3.7-4 hits stable (which is more important ATM).

    Anyway, your explanation makes sense and I agree, my initial workaround for the icon problem was not well founded and was simply focused on somehow working around that crashes.

     
  • Eduard Bloch
    Eduard Bloch
    2012-05-27

    Update: sorry, this page does NOT work well on 64-bit and the adoptation is not as trivial as you claimed in https://sourceforge.net/mailarchive/message.php?msg_id=25125642 .

    Changing as above cuts the icon to the half and adds random garbage to the second half.

    If I change the call of GetFullWindowProperty (itemSize parameter from 32 to 8*sizeof(long) ) then some icons appear, some still don't appear and some appear with a garbled palette. There must be some very simple explanation but I haven't figured it out yet.

    Anyhow, for the time being, I think I will refrain from adding this patch. Having no icon is better than having many garbled icons.

     
  • Marcus Moeller
    Marcus Moeller
    2012-05-27

    @thefirstone have you just tried to apply the wmclient.cc patch from below? It works fine on a nearly unpatched and current 64bit build here (only use_ICEWM_deprecated.patch and package_build_fixes + the below wmclient patch). I have never experienced any of the described problems, btw.

     
  • thefirstone,

    Can you please tell what modifications precisely you did when applying the patch and why? Here it works flawlessly on 64 bit without any changes (if you read carefully the documentation you will see that no modification is needed for 64 bit).

     
  • Marcus Moeller
    Marcus Moeller
    2012-06-11

    @thefirstone:

    I have used the following patch on several installations and architectures and can confirm that it works fine:

    http://paste.debian.net/174019/

    Never experienced any cropped icons.