make Statusbar optional in get_display_info()
This commit is contained in:
parent
972ea8f832
commit
14da15bbc9
8
screen.c
8
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
|
||||
|
|
2
screen.h
2
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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue