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 320034 - transparency gtkstatusicon
transparency gtkstatusicon
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2005-10-28 04:22 UTC by Jochen Baier
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
da patch (1.31 KB, patch)
2005-10-28 04:24 UTC, Jochen Baier
none Details | Review
da notification applet patch (4.95 KB, patch)
2005-10-29 00:10 UTC, Jochen Baier
none Details | Review

Description Jochen Baier 2005-10-28 04:22:36 UTC
Patch will add transparency to the gtkstatusicon.
It will use ParentRelative Window stuff.
Works out of the box with KDE. Gnome Notification area needs to be motified
(set the panel background pixmap to the socket window,for color background
create a colored pixmap instead of drawing a rectangle directly).

similiar Bugs: 

http://bugzilla.gnome.org/show_bug.cgi?id=150726
http://bugzilla.gnome.org/show_bug.cgi?id=306974
Comment 1 Jochen Baier 2005-10-28 04:24:30 UTC
Created attachment 53973 [details] [review]
da patch
Comment 2 Allison Karlitskaya (desrt) 2005-10-28 06:29:33 UTC
This is substantially the same approach as taken in bug 150726.  I've discussed
with the author of the patches there and done some experiment on my own.  Both
of us were able to independently convince ourselves that this absolutely won't
work without some significant active hackery (ie: it's not something that you
can just change a couple of properties for and have it automatically work from
then on).
Comment 3 Ilya Konstantinov 2005-10-28 10:14:40 UTC
Yes, Jochen, just how is your approach different from the patch I've provided in
bug 150726? I set parent-relative on the main widget:
  gdk_window_set_back_pixmap (widget->window, NULL, TRUE);
while you set it through the style:
  style = gtk_style_copy (widget->style);
  style->bg_pixmap[GTK_STATE_NORMAL] = (GdkPixmap*) GDK_PARENT_RELATIVE;
  gtk_widget_set_style (widget, style);
  g_object_unref (style);

Does this make any difference?
Comment 4 Jochen Baier 2005-10-28 12:23:02 UTC
Ryan: it IS working here. notificiation area only need about 20-30 lines of new
code. I will make a patch tonight to play with.

Ilya: i dont see the problem if a change the icons. probably cause the window
background is cleared on expose events. 
Comment 5 Ilya Konstantinov 2005-10-28 12:31:43 UTC
Jochen:
1. What code should be added to the notification area?
2. Why would changing the pixmap fire an expose event at its parent? And what
"clearing" can occur, if the backgrond mode is parent-relative? You explicitly
tell the pixmap's parent not to draw itself in any way, so how should it "clean"
itself?
3. If you thought this approach is okay, why not use my patch then? Mine is
shorter and better-documented and I don't see any difference in the technical
approach. I'm sorry if it comes off a bit ego-driven, but why disregard past
work? Also, there's a hefty amount of discussion on bug 150726, so why didn't
you respond to it?
Comment 6 Jochen Baier 2005-10-29 00:09:25 UTC
so the patch for the gnome notifcation
area:(cvs/gnome/gnome-panel/applets/notification_area)

it is not a real patch only something to play with.
i found one ugly problem: during docking the background of the new tray icon
locks weird.

Ryan: can you make a new patch against gtkstatusicon and notifyarea ? so we have
something to compare.

Ilya: take a look on the code
Comment 7 Jochen Baier 2005-10-29 00:10:17 UTC
Created attachment 54025 [details] [review]
da notification applet patch
Comment 8 Jochen Baier 2005-10-29 23:07:10 UTC
i have new idea to improve the things:

the client send a dock request with a invisible window as data.
the invisible window have a pixmap set. the manager/trayarea can now use this
pixmap and draw it onself. (this should remove the flicker/update background
problems). Events will first handled by the trayarea and then send to the
invsible window as clientmessages. to change the icon the trayarea must listen
for pixmap changes.

comments ?
Comment 9 Jochen Baier 2005-12-06 17:42:04 UTC
is this concept (last post) so bad/boring ?
Comment 10 Matthias Clasen 2005-12-06 17:51:36 UTC
no, but it is one of 1000 open issues in bugzilla
Comment 11 Matthias Clasen 2006-03-15 21:54:04 UTC
So, I think what needs to happen here is that somebody
needs to adapt Dan Winships patch from bug   150726 to GtkStatusIcon.
Of course, we also need to fix the notification area.
Comment 12 Matthias Clasen 2006-06-19 23:54:04 UTC
2006-06-19  Matthias Clasen  <mclasen@redhat.com>

	Make transparent tray icons work.  (#320034, based on a 
	patch by Dan Winship)
	
	* gtk/gtktrayicon-x11.c (gtk_tray_icon_init): Make trayicons
	app-paintable and non-double buffered. 

	* gtk/gtkrc.c (_gtk_rc_init): Give tray icons a parent-relative
	background in the default style.