mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
have screen_find_xinerama() return struct geom *reliably* instead of
XineramaScreenInfo; simplifies goop around the callers.
This commit is contained in:
18
screen.c
18
screen.c
@ -146,22 +146,30 @@ screen_init_xinerama(struct screen_ctx *sc)
|
||||
/*
|
||||
* Find which xinerama screen the coordinates (x,y) is on.
|
||||
*/
|
||||
XineramaScreenInfo *
|
||||
struct geom
|
||||
screen_find_xinerama(struct screen_ctx *sc, int x, int y)
|
||||
{
|
||||
XineramaScreenInfo *info;
|
||||
struct geom geom;
|
||||
int i;
|
||||
|
||||
geom = sc->view;
|
||||
|
||||
if (sc->xinerama == NULL)
|
||||
return (NULL);
|
||||
return (geom);
|
||||
|
||||
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);
|
||||
y >= info->y_org && y < info->y_org + info->height) {
|
||||
geom.x = info->x_org;
|
||||
geom.y = info->y_org;
|
||||
geom.w = info->width;
|
||||
geom.h = info->height;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return (NULL);
|
||||
return (geom);
|
||||
}
|
||||
|
||||
void
|
||||
|
Reference in New Issue
Block a user