aboutsummaryrefslogtreecommitdiffstats
path: root/screen.c
diff options
context:
space:
mode:
authorokan2009-01-15 00:32:35 +0000
committerokan2009-01-15 00:32:35 +0000
commit4ea881a1f870bea94491fb83611d469364f0c227 (patch)
tree0ffa1093781623d83f7dd0cc174e930316e0892e /screen.c
parent8e6d310a315d869ce38842e29b3044521303d870 (diff)
downloadcwm-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 '')
-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);
+}