systray: Resize icons only if necessary

This commit is contained in:
o9000 2015-07-15 09:53:09 +02:00
parent 8d5c2d8cbb
commit 2570ae2cf6

View file

@ -761,6 +761,8 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
Panel* panel = systray.area.panel; Panel* panel = systray.area.panel;
//fprintf(stderr, "move tray %d\n", traywin->x); //fprintf(stderr, "move tray %d\n", traywin->x);
if (e->xconfigure.width != traywin->width || e->xconfigure.height != traywin->height || e->xconfigure.x != 0 || e->xconfigure.y != 0) {
XMoveResizeWindow(server.dsp, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height); XMoveResizeWindow(server.dsp, traywin->parent, traywin->x, traywin->y, traywin->width, traywin->height);
if (traywin->reparented) { if (traywin->reparented) {
XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height); XMoveResizeWindow(server.dsp, traywin->win, 0, 0, traywin->width, traywin->height);
@ -768,6 +770,8 @@ void systray_reconfigure_event(TrayWindow *traywin, XEvent *e)
stop_timeout(traywin->render_timeout); stop_timeout(traywin->render_timeout);
traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout); traywin->render_timeout = add_timeout(min_refresh_period, 0, systray_render_icon, traywin, &traywin->render_timeout);
} }
}
// Resize and redraw the systray // Resize and redraw the systray
if (systray_profile) if (systray_profile)
fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__); fprintf(stderr, BLUE "[%f] %s:%d trigger resize & redraw\n" RESET, profiling_get_time(), __FUNCTION__, __LINE__);