Systraybar systray;
int refresh_systray;
int systray_enabled;
-int systray_max_icon_size = 0;
+int systray_max_icon_size;
// background pixmap if we render ourselves the icons
-static Pixmap render_background = 0;
+static Pixmap render_background;
+void default_systray()
+{
+ memset(&systray, 0, sizeof(Systraybar));
+ render_background = 0;
+ systray.alpha = 100;
+ systray.sort = 3;
+ systray.area._draw_foreground = draw_systray;
+ systray.area._resize = resize_systray;
+}
+
+void cleanup_systray()
+{
+ systray_enabled = 0;
+ systray_max_icon_size = 0;
+ systray.area.on_screen = 0;
+ free_area(&systray.area);
+ if (render_background) {
+ XFreePixmap(server.dsp, render_background);
+ render_background = 0;
+ }
+}
+
void init_systray()
{
start_net();
systray.alpha = 100;
systray.brightness = systray.saturation = 0;
}
- systray.area._draw_foreground = draw_systray;
- systray.area._resize = resize_systray;
systray.area.resize = 1;
systray.area.redraw = 1;
systray.area.on_screen = 1;
}
-void cleanup_systray()
-{
- systray_enabled = 0;
- systray.area.on_screen = 0;
- free_area(&systray.area);
- if (render_background) XFreePixmap(server.dsp, render_background);
-}
-
-
void draw_systray(void *obj, cairo_t *c)
{
- if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
+ if (server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
if (render_background) XFreePixmap(server.dsp, render_background);
render_background = XCreatePixmap(server.dsp, server.root_win, systray.area.width, systray.area.height, server.depth);
XCopyArea(server.dsp, systray.area.pix, render_background, server.gc, 0, 0, systray.area.width, systray.area.height, 0, 0);
// watch for the icon trying to resize itself!
XSelectInput(server.dsp, traywin->tray_id, StructureNotifyMask);
- if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
+ if (server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
traywin->damage = XDamageCreate(server.dsp, traywin->id, XDamageReportRawRectangles);
XCompositeRedirectWindow(server.dsp, traywin->id, CompositeRedirectManual);
}
printf("Strange tray icon found with depth: %d\n", traywin->depth);
return;
}
- Picture pict_image = XRenderCreatePicture(server.dsp, traywin->id, f, 0, 0);
+ Picture pict_image;
+ if (server.real_transparency)
+ pict_image = XRenderCreatePicture(server.dsp, traywin->id, f, 0, 0);
+ else
+ pict_image = XRenderCreatePicture(server.dsp, traywin->tray_id, f, 0, 0);
Picture pict_drawable = XRenderCreatePicture(server.dsp, tmp_pmap, XRenderFindVisualFormat(server.dsp, server.visual32), 0, 0);
XRenderComposite(server.dsp, PictOpSrc, pict_image, None, pict_drawable, 0, 0, 0, 0, 0, 0, traywin->width, traywin->height);
XRenderFreePicture(server.dsp, pict_image);
void systray_render_icon(TrayWindow* traywin)
{
- if (real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
+ if (server.real_transparency || systray.alpha != 100 || systray.brightness != 0 || systray.saturation != 0) {
// wine tray icons update whenever mouse is over them, so we limit the updates to 50 ms
if (traywin->render_timeout == 0)
traywin->render_timeout = add_timeout(50, 0, systray_render_icon_now, traywin);