systray: handle window that are on phys_screen only

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-06-15 10:50:50 +02:00
parent f418cb0c2e
commit 72957f999a

View file

@ -43,6 +43,7 @@ systray_draw(draw_context_t *ctx,
phys_screen = screen_virttophys(screen);
for(em = globalconf.embedded; em; em = em->next)
if(em->phys_screen == phys_screen)
i++;
if(ctx->width - used > 0)
@ -72,6 +73,8 @@ systray_draw(draw_context_t *ctx,
config_win_vals[1] = sb->sw->geometry.y + sb->sw->geometry.height
- w->area.x - config_win_vals[3];
for(em = globalconf.embedded; em; em = em->next)
if(em->phys_screen == phys_screen)
{
if(config_win_vals[1] - config_win_vals[2] >= (uint32_t) sb->sw->geometry.y)
{
xcb_map_window(globalconf.connection, em->win);
@ -87,11 +90,14 @@ systray_draw(draw_context_t *ctx,
}
else
xcb_unmap_window(globalconf.connection, em->win);
}
break;
case Right:
config_win_vals[0] = sb->sw->geometry.x - w->area.y;
config_win_vals[1] = sb->sw->geometry.y + w->area.x;
for(em = globalconf.embedded; em; em = em->next)
if(em->phys_screen == phys_screen)
{
if(config_win_vals[1] + config_win_vals[3] <= (uint32_t) sb->sw->geometry.y + ctx->width)
{
xcb_map_window(globalconf.connection, em->win);
@ -107,6 +113,7 @@ systray_draw(draw_context_t *ctx,
}
else
xcb_unmap_window(globalconf.connection, em->win);
}
break;
default:
/* x */
@ -115,6 +122,8 @@ systray_draw(draw_context_t *ctx,
config_win_vals[1] = sb->sw->geometry.y + w->area.y;
for(em = globalconf.embedded; em; em = em->next)
if(em->phys_screen == phys_screen)
{
/* if(x + width < systray.x + systray.width) */
if(config_win_vals[0] + config_win_vals[2] <= (uint32_t) AREA_RIGHT(w->area) + sb->sw->geometry.x)
{
@ -131,6 +140,7 @@ systray_draw(draw_context_t *ctx,
}
else
xcb_unmap_window(globalconf.connection, em->win);
}
break;
}