From 4ea881a1f870bea94491fb83611d469364f0c227 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 15 Jan 2009 00:32:35 +0000 Subject: - 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@ --- screen.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'screen.c') diff --git a/screen.c b/screen.c index 099543f..65b8ca3 100644 --- a/screen.c +++ b/screen.c @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $Id: screen.c,v 1.13 2009/01/11 18:25:49 okan Exp $ + * $Id: screen.c,v 1.14 2009/01/15 00:32:35 okan Exp $ */ #include "headers.h" @@ -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); +} -- cgit v1.2.3-2-gb3c3