[PATCH 1/2] Move pointOnScreen to inpututils.c

Peter Hutterer peter.hutterer at who-t.net
Thu Sep 1 20:59:11 PDT 2011


We need this from other files too.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/events.c     |   11 ++---------
 dix/inpututils.c |    8 ++++++++
 include/input.h  |    2 ++
 3 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/dix/events.c b/dix/events.c
index 8935ad9..199d115 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -498,13 +498,6 @@ SyntheticMotion(DeviceIntPtr dev, int x, int y) {
 static void PostNewCursor(DeviceIntPtr pDev);
 
 static Bool
-pointOnScreen(ScreenPtr pScreen, int x, int y)
-{
-    return x >= pScreen->x && x < pScreen->x + pScreen->width &&
-           y >= pScreen->y && y < pScreen->y + pScreen->height;
-}
-
-static Bool
 XineramaSetCursorPosition(
     DeviceIntPtr pDev,
     int x,
@@ -523,13 +516,13 @@ XineramaSetCursorPosition(
     x += screenInfo.screens[0]->x;
     y += screenInfo.screens[0]->y;
 
-    if(!pointOnScreen(pScreen, x, y))
+    if(!point_on_screen(pScreen, x, y))
     {
 	FOR_NSCREENS(i)
 	{
 	    if(i == pScreen->myNum)
 		continue;
-	    if(pointOnScreen(screenInfo.screens[i], x, y))
+	    if(point_on_screen(screenInfo.screens[i], x, y))
 	    {
 		pScreen = screenInfo.screens[i];
 		break;
diff --git a/dix/inpututils.c b/dix/inpututils.c
index 49e1758..0cecc62 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -37,6 +37,7 @@
 #include "xkbstr.h"
 #include "inpututils.h"
 #include "eventstr.h"
+#include "scrnintstr.h"
 
 /* Check if a button map change is okay with the device.
  * Returns -1 for BadValue, as it collides with MappingBusy. */
@@ -584,3 +585,10 @@ void verify_internal_event(const InternalEvent *ev)
         FatalError("Wrong event type %d. Aborting server\n", ev->any.header);
     }
 }
+
+Bool
+point_on_screen(ScreenPtr pScreen, int x, int y)
+{
+    return x >= pScreen->x && x < pScreen->x + pScreen->width &&
+           y >= pScreen->y && y < pScreen->y + pScreen->height;
+}
diff --git a/include/input.h b/include/input.h
index 5377a0c..858d572 100644
--- a/include/input.h
+++ b/include/input.h
@@ -595,4 +595,6 @@ extern _X_EXPORT void valuator_mask_copy(ValuatorMask *dest,
                                          const ValuatorMask *src);
 extern _X_EXPORT int valuator_mask_get(const ValuatorMask *mask, int valnum);
 
+extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
+
 #endif /* INPUT_H */
-- 
1.7.6



More information about the xorg-devel mailing list