diff --git a/screen.c b/screen.c index 66419965..616437ed 100644 --- a/screen.c +++ b/screen.c @@ -76,17 +76,17 @@ get_screen_info(Display *disp, int screen, Statusbar *statusbar, int *screen_num * \return ScreenInfo struct pointer with all display info */ ScreenInfo * -get_display_info(Display *disp, int screen, Statusbar statusbar) +get_display_info(Display *disp, int screen, Statusbar *statusbar) { ScreenInfo *si; si = p_new(ScreenInfo, 1); si->x_org = 0; - si->y_org = statusbar.position == BarTop ? statusbar.height : 0; + si->y_org = statusbar && statusbar->position == BarTop ? statusbar->height : 0; si->width = DisplayWidth(disp, screen); si->height = DisplayHeight(disp, screen) - - ((statusbar.position == BarTop || statusbar.position == BarBot) ? statusbar.height : 0); + (statusbar && (statusbar->position == BarTop || statusbar->position == BarBot) ? statusbar->height : 0); return si; } @@ -118,7 +118,7 @@ get_screen_bycoord(Display *disp, int x, int y) } XFree(si); - return -1; + return 0; } /** Return the actual screen count diff --git a/screen.h b/screen.h index 6b49a90b..ad408e0c 100644 --- a/screen.h +++ b/screen.h @@ -29,7 +29,7 @@ typedef XineramaScreenInfo ScreenInfo; ScreenInfo * get_screen_info(Display *, int, Statusbar *, int *); -ScreenInfo * get_display_info(Display *, int, Statusbar); +ScreenInfo * get_display_info(Display *, int, Statusbar *); int get_screen_bycoord(Display *, int, int); int get_screen_count(Display *); UICB_PROTO(uicb_focusnextscreen); diff --git a/statusbar.c b/statusbar.c index d5be960d..3ca088b1 100644 --- a/statusbar.c +++ b/statusbar.c @@ -147,7 +147,7 @@ updatebarpos(Display *disp, Statusbar statusbar) XMoveWindow(disp, statusbar.window, 0, 0); break; case BarBot: - si = get_display_info(disp, statusbar.screen, statusbar); + si = get_display_info(disp, statusbar.screen, &statusbar); XMoveWindow(disp, statusbar.window, 0, si->height); XFree(si); break;