aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c20
1 files changed, 19 insertions, 1 deletions
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);
+}