all repos — tint2 @ ea75558ac2c0e357b96caa38a9835e2d1e86893c

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

systray: reduce icon flicker by painting on buffer instead of directly on window
o9000 o9000
commit

ea75558ac2c0e357b96caa38a9835e2d1e86893c

parent

876cae8239aa715bb3f911d40fcf7726bbda2cc5

2 files changed, 12 insertions(+), 14 deletions(-)

jump to
M src/systray/systraybar.csrc/systray/systraybar.c

@@ -923,7 +923,7 @@ adjust_asb(data, traywin->width, traywin->height, systray.alpha, (float)systray.saturation/100, (float)systray.brightness/100);

imlib_image_put_back_data(data); XCopyArea(server.dsp, render_background, systray.area.pix, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x-systray.area.posx, traywin->y-systray.area.posy); render_image(systray.area.pix, traywin->x-systray.area.posx, traywin->y-systray.area.posy); - XCopyArea(server.dsp, systray.area.pix, panel->main_win, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y); + XCopyArea(server.dsp, systray.area.pix, panel->temp_pmap, server.gc, traywin->x-systray.area.posx, traywin->y-systray.area.posy, traywin->width, traywin->height, traywin->x, traywin->y); imlib_free_image_and_decache(); XFreePixmap(server.dsp, tmp_pmap); imlib_context_set_visual(server.visual);
M src/tint.csrc/tint.c

@@ -1133,28 +1133,26 @@ if (systray_profile)

fprintf(stderr, BLUE "[%f] %s:%d redrawing panel\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__); panel_refresh = 0; - for (i=0 ; i < nb_panel ; i++) { + for (i = 0; i < nb_panel ;i++) { panel = &panel1[i]; if (panel->is_hidden) { XCopyArea(server.dsp, panel->hidden_pixmap, panel->main_win, server.gc, 0, 0, panel->hidden_width, panel->hidden_height, 0, 0); XSetWindowBackgroundPixmap(server.dsp, panel->main_win, panel->hidden_pixmap); - } - else { - if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap); + } else { + if (panel->temp_pmap) + XFreePixmap(server.dsp, panel->temp_pmap); panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth); rendering(panel); + if (panel == (Panel*)systray.area.panel) { + if (refresh_systray && panel && !panel->is_hidden) { + refresh_systray = 0; + XSetWindowBackgroundPixmap(server.dsp, panel->main_win, panel->temp_pmap); + refresh_systray_icons(); + } + } XCopyArea(server.dsp, panel->temp_pmap, panel->main_win, server.gc, 0, 0, panel->area.width, panel->area.height, 0, 0); } - } - - panel = (Panel*)systray.area.panel; - if (refresh_systray && panel && !panel->is_hidden) { - refresh_systray = 0; - // tint2 doen't draw systray icons. it just redraw background. - XSetWindowBackgroundPixmap(server.dsp, panel->main_win, panel->temp_pmap); - // force icon's refresh - refresh_systray_icons(); } XFlush(server.dsp); }