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,7 +43,8 @@ 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)
i++; if(em->phys_screen == phys_screen)
i++;
if(ctx->width - used > 0) if(ctx->width - used > 0)
w->area.width = MIN(i * ctx->height, ctx->width - used); w->area.width = MIN(i * ctx->height, ctx->width - used);
@ -72,41 +73,47 @@ 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(config_win_vals[1] - config_win_vals[2] >= (uint32_t) sb->sw->geometry.y) if(em->phys_screen == phys_screen)
{ {
xcb_map_window(globalconf.connection, em->win); if(config_win_vals[1] - config_win_vals[2] >= (uint32_t) sb->sw->geometry.y)
xcb_configure_window(globalconf.connection, em->win, {
XCB_CONFIG_WINDOW_X xcb_map_window(globalconf.connection, em->win);
| XCB_CONFIG_WINDOW_Y xcb_configure_window(globalconf.connection, em->win,
| XCB_CONFIG_WINDOW_WIDTH XCB_CONFIG_WINDOW_X
| XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_Y
| XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_WIDTH
| XCB_CONFIG_WINDOW_STACK_MODE, | XCB_CONFIG_WINDOW_HEIGHT
config_win_vals); | XCB_CONFIG_WINDOW_SIBLING
config_win_vals[1] -= config_win_vals[3]; | XCB_CONFIG_WINDOW_STACK_MODE,
config_win_vals);
config_win_vals[1] -= config_win_vals[3];
}
else
xcb_unmap_window(globalconf.connection, em->win);
} }
else
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(config_win_vals[1] + config_win_vals[3] <= (uint32_t) sb->sw->geometry.y + ctx->width) if(em->phys_screen == phys_screen)
{ {
xcb_map_window(globalconf.connection, em->win); if(config_win_vals[1] + config_win_vals[3] <= (uint32_t) sb->sw->geometry.y + ctx->width)
xcb_configure_window(globalconf.connection, em->win, {
XCB_CONFIG_WINDOW_X xcb_map_window(globalconf.connection, em->win);
| XCB_CONFIG_WINDOW_Y xcb_configure_window(globalconf.connection, em->win,
| XCB_CONFIG_WINDOW_WIDTH XCB_CONFIG_WINDOW_X
| XCB_CONFIG_WINDOW_HEIGHT | XCB_CONFIG_WINDOW_Y
| XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_WIDTH
| XCB_CONFIG_WINDOW_STACK_MODE, | XCB_CONFIG_WINDOW_HEIGHT
config_win_vals); | XCB_CONFIG_WINDOW_SIBLING
config_win_vals[1] += config_win_vals[3]; | XCB_CONFIG_WINDOW_STACK_MODE,
config_win_vals);
config_win_vals[1] += config_win_vals[3];
}
else
xcb_unmap_window(globalconf.connection, em->win);
} }
else
xcb_unmap_window(globalconf.connection, em->win);
break; break;
default: default:
/* x */ /* x */
@ -115,22 +122,25 @@ 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(x + width < systray.x + systray.width) */ if(em->phys_screen == phys_screen)
if(config_win_vals[0] + config_win_vals[2] <= (uint32_t) AREA_RIGHT(w->area) + sb->sw->geometry.x)
{ {
xcb_map_window(globalconf.connection, em->win); /* if(x + width < systray.x + systray.width) */
xcb_configure_window(globalconf.connection, em->win, if(config_win_vals[0] + config_win_vals[2] <= (uint32_t) AREA_RIGHT(w->area) + sb->sw->geometry.x)
XCB_CONFIG_WINDOW_X {
| XCB_CONFIG_WINDOW_Y xcb_map_window(globalconf.connection, em->win);
| XCB_CONFIG_WINDOW_WIDTH xcb_configure_window(globalconf.connection, em->win,
| XCB_CONFIG_WINDOW_HEIGHT XCB_CONFIG_WINDOW_X
| XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_Y
| XCB_CONFIG_WINDOW_STACK_MODE, | XCB_CONFIG_WINDOW_WIDTH
config_win_vals); | XCB_CONFIG_WINDOW_HEIGHT
config_win_vals[0] += config_win_vals[2]; | XCB_CONFIG_WINDOW_SIBLING
| XCB_CONFIG_WINDOW_STACK_MODE,
config_win_vals);
config_win_vals[0] += config_win_vals[2];
}
else
xcb_unmap_window(globalconf.connection, em->win);
} }
else
xcb_unmap_window(globalconf.connection, em->win);
break; break;
} }