Menu

#8 icewmtray: transparent parts of gdk/gtk app icons broken

open
nobody
None
2
2006-09-11
2004-04-02
No

icewmtray doesn't handle the transparent parts of gdk/gtk based application icons properly. This is especially noticable with themes that do not use a light-gray toolbar background. Qt based application icons (eg. sim) seem to be handled correctly.

The attached screenshot shows three icons in icewmtray's systray area: sim[1] (the red flower, Qt-based, transparency ok), xpad[2] (the yellow post-it, gdk/gtk-based, transparency wrong) and gaim[3]/opengaim[4] (the small yellow guy, gdk/gtk/gnome2-based, transparency wrong). Note that the xmms and aumix icons on the left aren't systray icons handled by icewmtray, but minimized-to-tray-exclusively icons handled by icewm (ie. *.tray: Exclusive in ~/.icewm/winoptions).

This problem only affects icewmtray, whereas the transparent parts are handled properly in all other areas (menu, toolbar buttons, window icons, minimized-window toolbar icons). I'm using xfree86-4.2.1, icewm-1.2.14pre12 and gtk+2.4.0 (the problem was also present with gtk+-2.2.x).

[1] http://prdownloads.sourceforge.net/sim-icq/sim-0.9.3-2.tar.gz?download
[2] http://prdownloads.sourceforge.net/xpad/xpad-1.13.tar.bz2?download
[3] http://prdownloads.sourceforge.net/gaim/gaim-0.76.tar.bz2?download
[4] http://belnet.dl.sourceforge.net/sourceforge/opengaim/opengaim-0.75c.tar.gz

Discussion

  • Thomas Zajic

    Thomas Zajic - 2004-04-02

    Taskbar screenshot

     
  • Adam Pribyl

    Adam Pribyl - 2004-04-02

    Logged In: YES
    user_id=607018

    I think it's not a bug. See also bug #883784 and the refered
    one.

    The "not transparent" backgournd is caused by the fact, that
    the icon in tray from gtk apps is provided by gtk - with
    background set by gtk. Means if you change gtk theme, also
    the color in tray will change. At least this way it worked
    with qt and kde apps.

     
  • Marko Macek

    Marko Macek - 2004-04-04
    • assigned_to: nobody --> captnmark
     
  • Thomas Zajic

    Thomas Zajic - 2004-04-04

    Logged In: YES
    user_id=150806

    Yes, you're right - thanks for the hint! :-)

    After looking through
    http://www.gtk.org/tutorial/sec-widgethierarchy.html,
    http://www.gtk.org/tutorial/sec-widgetswithoutwindows.html
    and a couple of assorted GTK+ header files, it appears that
    GTK's standard functions for providing a tray icon use the
    GtkEventBox widget class. Setting an appropriate background
    color for this widget class in ~/.gtkrc-2.0 solves the problem.

    Just in case someone else gets bitten by this, here's the
    relevant part from my ~/.gtkrc-2.0:

    style "user-image" {
    bg[NORMAL] = { 0.67, 0.74, 0.70 }
    }
    class "GtkEventBox" style "user-image"

    Again, thanks for the hint!

     
  • Thomas Zajic

    Thomas Zajic - 2004-04-04

    Logged In: YES
    user_id=150806

    Something related just came to my mind - a feature request
    for the wishlist maybe? Would it be possible for icewmtray to:

    1. Detect whether GTK+ is available (maybe simply via
    "#ifdef CONFIG_GNOME_MENUS"?)
    2. If yes, remember the current value of GtkEventBox::bg[NORMAL]
    3. Set GtkEventBox::bg[NORMAL] to the current
    ColorDefaultTaskBar
    4. Draw the systray icon as usual
    5. Restore the original value of GtkEventBox::bg[NORMAL]
    6. Continue as usual

    This would definitely be a nice addition (although pure eye
    candy, admittedly ;-) - users wouldn't need to fiddle around
    with their ~/.gtkrc files, and the systray icons would
    automagically show the right transparency color even after
    switching IceWM's theme.

    Comments?

     
  • Thomas Zajic

    Thomas Zajic - 2004-04-04

    Logged In: YES
    user_id=150806

    Okay, this most probably won't work, because (as far as I
    understand the underlying mechanisms) GTK+ applications do
    the resource file parsing by themselves, so icewmtray
    basically only receives (a pointer to) the ready-to-display
    icon with GTK+ theme settings already applied.

    Alternative proposal (and probably easier to implement as well):

    In addition to writing ~/.icewm/theme, write a small
    ~/.icewm/gtkrc containing the few lines below, with
    fg[NORMAL] set to the current ColorDefaultTaskBar value
    (GTK+ also accepts standard "#abcdef" hex color triplets in
    double quotes as color values, so there's no need to convert
    icewm's internal format to GTK+ style float triplets). Then
    leave it up to the user to use this setting via either the
    $GTK2_RC_FILES environment variable or a simple "include
    ~/.icewm/gtkrc" statement in their ~/.gtkrc[-2.0] files.

    Advantages of this approach: no bloat (ie. no need to link
    icewmtray against GTK+, just write a small textfile),
    flexible (ie. easily expandable/adjustable for future GTK+
    versions), rather easy to do for the user (ie. add the
    "include" statment once, and be done with it - the result is
    updated automagically).

    I'll probably submit an appropriate patch myself when/if I
    get around to do it.

     
  • Marko Macek

    Marko Macek - 2004-04-06
    • labels: 319566 --> 319567
     
  • Marko Macek

    Marko Macek - 2004-04-06

    Logged In: YES
    user_id=1814

    automatic generation of (part of?) .gtkrc might be done for
    icewm-1.3

     
  • Marko Macek

    Marko Macek - 2004-08-12
    • priority: 5 --> 2
     
  • Marko Macek

    Marko Macek - 2006-09-11
    • labels: 319567 -->
    • milestone: 102463 -->
    • assigned_to: captnmark --> nobody
     

Log in to post a comment.