summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-08-30 16:58:04 -0400
committerPeter Hutterer <peter.hutterer@who-t.net>2011-10-04 13:01:33 +1000
commit911e7368bf9c00d327e994a6f7a1d8d8f9b83c72 (patch)
treecbe7ae09f12d41d344189cc492c77c627c31fca1
parentd0a7cd759d4741a1ae118d579c90704410cde244 (diff)
Move pointOnScreen to inpututils.c
We need this from other files too. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r--dix/events.c11
-rw-r--r--dix/inpututils.c8
-rw-r--r--include/input.h2
3 files changed, 12 insertions, 9 deletions
diff --git a/dix/events.c b/dix/events.c
index 0f5b042e3..f87d2bbf9 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -525,13 +525,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,
@@ -550,13 +543,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 0a3d3d8b4..eeae2a74f 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. */
@@ -619,6 +620,13 @@ void init_device_event(DeviceEvent *event, DeviceIntPtr dev, Time ms)
event->sourceid = dev->id;
}
+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;
+}
+
/**
* Delete the element with the key from the list, freeing all memory
* associated with the element..
diff --git a/include/input.h b/include/input.h
index 6ba1ab200..b7de5ca3d 100644
--- a/include/input.h
+++ b/include/input.h
@@ -608,4 +608,6 @@ extern _X_EXPORT const char* input_option_get_value(const InputOption *opt);
extern _X_EXPORT void input_option_set_key(InputOption *opt, const char* key);
extern _X_EXPORT void input_option_set_value(InputOption *opt, const char* value);
+extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y);
+
#endif /* INPUT_H */