make Statusbar optional in get_display_info()

This commit is contained in:
Julien Danjou 2007-09-27 20:11:31 +02:00
parent 972ea8f832
commit 14da15bbc9
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;