mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
- add missing prototypes.
- properly name, place and static private functions. - move function which finds the xinerama screen for a coordinate to a more appropriate place while altering its semantics to match others. - tiny bit of style. ok oga@
This commit is contained in:
18
screen.c
18
screen.c
@ -92,3 +92,21 @@ screen_init_xinerama(struct screen_ctx *sc)
|
||||
sc->xinerama = info;
|
||||
sc->xinerama_no = no;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find which xinerama screen the coordinates (x,y) is on.
|
||||
*/
|
||||
XineramaScreenInfo *
|
||||
screen_find_xinerama(struct screen_ctx *sc, int x, int y)
|
||||
{
|
||||
XineramaScreenInfo *info;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < sc->xinerama_no; i++) {
|
||||
info = &sc->xinerama[i];
|
||||
if (x > info->x_org && x < info->x_org + info->width &&
|
||||
y > info->y_org && y < info->y_org + info->height)
|
||||
return (info);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user