diff -urN --exclude-from=/usr/src/exclude gpm-1.20.1/src/evdev.c gpm/src/evdev.c
--- gpm-1.20.1/src/evdev.c	2003-08-24 18:06:56.000000000 -0500
+++ gpm/src/evdev.c	2003-08-24 18:04:18.000000000 -0500
@@ -20,12 +20,10 @@
  ********/
 
 
-#include <math.h>                /* ceil */
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
-#include <errno.h>
 #include <time.h>
 #include <sys/select.h>
 #include <sys/time.h>
@@ -34,7 +32,8 @@
 #include <linux/input.h>
 
 #include "headers/gpm.h"
-#include "headers/gpmInt.h"       /* which_mouse */
+#include "headers/gpmInt.h"
+#include "headers/console.h"
 #include "headers/message.h"
 #include "headers/optparser.h"
 
@@ -348,7 +347,19 @@
          break;
 
       case EVDEV_ABSOLUTE:
-         state->x = pkt->abs_x; state->y = pkt->abs_y;
+         if (pkt->abs_x < evdev->left_edge) 
+            pkt->abs_x = evdev->left_edge;
+         else if (pkt->abs_x > evdev->right_edge) 
+            pkt->abs_x = evdev->right_edge;
+         if (pkt->abs_y < evdev->bottom_edge) 
+            pkt->abs_y = evdev->bottom_edge;
+         else if (pkt->abs_y > evdev->top_edge) 
+            pkt->abs_y = evdev->top_edge;
+         state->x = (pkt->abs_x - evdev->left_edge) * 
+                        console.max_x / (evdev->right_edge - evdev->left_edge);
+         state->y = (pkt->abs_y - evdev->bottom_edge) * 
+                        console.max_y / (evdev->top_edge - evdev->bottom_edge);
+         if (evdev->y_inversed) state->y = console.max_y - state->y;
          break;
 
       case EVDEV_TOUCHPAD:
@@ -444,6 +455,10 @@
       warn_if_present(optinfo, "tap_time", type);
       warn_if_present(optinfo, "touch_high", type);
       warn_if_present(optinfo, "touch_low", type);
+      if (evdev->right_edge <= evdev->left_edge)
+         gpm_report(GPM_PR_OOPS, "evdev: right edge value should be gerater then left");
+      if (evdev->top_edge <= evdev->bottom_edge)
+         gpm_report(GPM_PR_OOPS, "evdev: top edge value should be gerater then bottom");
    } else if (!strcmp(type, "touchpad")) {
       evdev->type = EVDEV_TOUCHPAD;
       evdev->dont_sync = 0;      /* touchpads need SYN support */   
