cht電腦資訊gcin
adm Find login register

tray icon 無法透明的可行之法?

caleb
joined: 2007-09-22
posted: 630
promoted: 134
bookmarked: 90
1subject: tray icon 無法透明的可行之法?Promote 1 Bookmark 22009-03-01quote  

不小心看到這篇:

http://blogs.sun.com/yongsun/entry/why_the_2nd_nested_window

看來又是 GTK+ 的 bug / feature, 換一層顯示大概就有透明了。

 

Why the 2nd nested window in systray_icon is solid gray?

星期四 十一月 06, 2008

From gnome-2.24, iiim-panel shows a gray border in gnome-panel, when gnome-panel is set with "Solid color" or "Background image". It turns out that the 2nd nested window (GtkDrawArea, or GtkEventBox) does not inherit the style from its ancestor containers. I tried to use gdk_window_set_back_pixmap to make it transparent, but failed. :(

Finally , I had to use the 1st nested window (GtkEventBox) to draw the icon and text.

P.S., here is the container hierarchy we used to have,

egg_tray_icon
\_ event_box
\_ hbox
\_ drawing_area 

cht電腦資訊gcin
adm Find login register
views:3278