Take BAR_OFFSET into account. Fixes #29.

This commit is contained in:
LemonBoy 2014-01-02 18:38:04 +00:00
parent 8404c78c18
commit cc34dab746

8
bar.c
View File

@ -442,9 +442,8 @@ init (void)
cur_screen->width -= BAR_OFFSET; cur_screen->width -= BAR_OFFSET;
/* Shift */ /* Shift */
if (cur_screen > screens) { if (cur_screen > screens)
memmove (screens, cur_screen, sizeof(screen_t) * num_screens); memmove (screens, cur_screen, sizeof(screen_t) * num_screens);
}
/* Reallocate */ /* Reallocate */
screens = realloc (screens, num_screens); screens = realloc (screens, num_screens);
@ -453,8 +452,9 @@ init (void)
#else #else
num_screens = 1; num_screens = 1;
screens = calloc(1, sizeof(screen_t)); screens = calloc(1, sizeof(screen_t));
screens[0].x = 0; /* Take into account the offset */
screens[0].width = bar_width; screens[0].x = BAR_OFFSET;
screens[0].width = bar_width - BAR_OFFSET;
/* Create the main window */ /* Create the main window */
int y = bar_bottom ? (scr->height_in_pixels - BAR_HEIGHT) : 0; int y = bar_bottom ? (scr->height_in_pixels - BAR_HEIGHT) : 0;
screens->window = create_window( root, screens->x, y, screens->width, BAR_HEIGHT, scr->root_visual ); screens->window = create_window( root, screens->x, y, screens->width, BAR_HEIGHT, scr->root_visual );