- // TODO : position and size the icon window when position of systray is known
- Systraybar *sysbar = obj;
- Panel *panel = sysbar->area.panel;
- int i, posx, posy, marging=3, icons_per_column=1, icons_per_row=1;
- int icon_size = 24;
- int start = panel->area.bg->border.width + panel->area.paddingy + systray.area.bg->border.width + systray.area.paddingy +marging/2;
- if (panel_horizontal) {
- posy = start;
- posx = systray.area.posx + systray.area.bg->border.width + systray.area.paddingxlr;
- }
- else {
- posx = start;
- posy = systray.area.posy + systray.area.bg->border.width + systray.area.paddingxlr;
- }
-
- TrayWindow *traywin;
- GSList *l;
- for (i=1, l = systray.list_icons; l ; i++, l = l->next) {
- traywin = (TrayWindow*)l->data;
- if (traywin->hide) continue;
-
- traywin->y = posy;
- traywin->x = posx;
- traywin->width = icon_size;
- traywin->height = icon_size;
- if (panel_horizontal) {
- if (i % icons_per_column)
- posy += icon_size + sysbar->area.paddingx;
- else {
- posy = start;
- posx += (icon_size + systray.area.paddingx);
- }
- }
- else {
- if (i % icons_per_row)
- posx += icon_size + systray.area.paddingx;
- else {
- posx = start;
- posy += (icon_size + systray.area.paddingx);
- }
- }
-
- // position and size the icon window
- XMoveResizeWindow(server.dsp, traywin->id, traywin->x, traywin->y, icon_size, icon_size);
- XResizeWindow(server.dsp, traywin->tray_id, icon_size, icon_size);
- }
-