diff options
author | okan | 2009-01-15 00:32:35 +0000 |
---|---|---|
committer | okan | 2009-01-15 00:32:35 +0000 |
commit | 4ea881a1f870bea94491fb83611d469364f0c227 (patch) | |
tree | 0ffa1093781623d83f7dd0cc174e930316e0892e /screen.c | |
parent | 8e6d310a315d869ce38842e29b3044521303d870 (diff) | |
download | cwm-4ea881a1f870bea94491fb83611d469364f0c227.tar.gz |
- 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@
Diffstat (limited to 'screen.c')
-rw-r--r-- | screen.c | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -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); +} |