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
1 changed files with 51 additions and 41 deletions

View File

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