Index: gtk/gtkinputdialog.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkinputdialog.c,v
retrieving revision 1.43.2.1
diff -u -r1.43.2.1 gtkinputdialog.c
--- gtk/gtkinputdialog.c	1 Mar 2005 06:28:56 -0000	1.43.2.1
+++ gtk/gtkinputdialog.c	6 Mar 2005 19:26:34 -0000
@@ -291,6 +291,15 @@
 		    G_CALLBACK (gtk_input_dialog_set_mapping_mode),
 		    GINT_TO_POINTER (GDK_MODE_WINDOW));
 
+#ifdef G_OS_WIN32
+  menuitem = gtk_menu_item_new_with_label(_("Screen (using system cursor position)"));
+  gtk_menu_shell_append (GTK_MENU_SHELL (mapping_menu), menuitem);
+  gtk_widget_show (menuitem);
+  g_signal_connect (menuitem, "activate",
+		    G_CALLBACK (gtk_input_dialog_set_mapping_mode),
+		    GINT_TO_POINTER (GDK_MODE_SCREEN_SYSCURSORPOS));
+#endif /* G_OS_WIN32 */
+
   label = gtk_label_new_with_mnemonic (_("_Mode: "));
   gtk_box_pack_start (GTK_BOX (util_box), label, FALSE, FALSE, 2);
   
Index: gdk/gdkinput.h
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/gdkinput.h,v
retrieving revision 1.18
diff -u -r1.18 gdkinput.h
--- gdk/gdkinput.h	28 Nov 2004 06:45:52 -0000	1.18
+++ gdk/gdkinput.h	6 Mar 2005 19:26:34 -0000
@@ -40,6 +40,10 @@
   GDK_MODE_DISABLED,
   GDK_MODE_SCREEN,
   GDK_MODE_WINDOW
+#ifdef G_OS_WIN32
+  ,
+  GDK_MODE_SCREEN_SYSCURSORPOS
+#endif /* G_OS_WIN32 */
 } GdkInputMode;
 
 typedef enum
Index: gdk/win32/gdkinput-win32.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkinput-win32.c,v
retrieving revision 1.50.2.2
diff -u -r1.50.2.2 gdkinput-win32.c
--- gdk/win32/gdkinput-win32.c	25 Feb 2005 00:09:52 -0000	1.50.2.2
+++ gdk/win32/gdkinput-win32.c	6 Mar 2005 19:26:34 -0000
@@ -570,7 +570,7 @@
   int y_axis = 0;
 
   double device_width, device_height;
-  double x_offset, y_offset, x_scale, y_scale;
+  double x_offset, y_offset, x_scale, y_scale, x, y;
 
   impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (input_window->window)->impl);
 
@@ -602,6 +602,18 @@
 
       x_offset = - input_window->root_x;
       y_offset = - input_window->root_y;
+      
+      x = x_scale*axis_data[x_axis] + x_offset;
+      y = y_scale*axis_data[y_axis] + y_offset;
+    }
+  else if (gdkdev->info.mode == GDK_MODE_SCREEN_SYSCURSORPOS) 
+    {
+      /* Useful when a device is set to relative mode in the tablet
+       * configuration (usual for pucks), see bug #154657 */
+      POINT pt;
+      GetCursorPos(&pt);
+      x = pt.x + _gdk_offset_x - input_window->root_x;
+      y = pt.y + _gdk_offset_y - input_window->root_y;
     }
   else				/* GDK_MODE_WINDOW */
     {
@@ -629,6 +641,8 @@
 	  y_offset = 0;
 	  x_offset = - (device_width * x_scale - impl->width)/2;
 	}
+      x = x_scale*axis_data[x_axis] + x_offset;
+      y = y_scale*axis_data[y_axis] + y_offset;
     }
 
   for (i=0; i<gdkdev->info.num_axes; i++)
@@ -636,14 +650,14 @@
       switch (gdkdev->info.axes[i].use)
 	{
 	case GDK_AXIS_X:
-	  axis_out[i] = x_offset + x_scale*axis_data[x_axis];
+	  axis_out[i] = x;
 	  if (x_out)
-	    *x_out = axis_out[i];
+	    *x_out = x;
 	  break;
 	case GDK_AXIS_Y:
-	  axis_out[i] = y_offset + y_scale*axis_data[y_axis];
+	  axis_out[i] = y;
 	  if (y_out)
-	    *y_out = axis_out[i];
+	    *y_out = y;
 	  break;
 	default:
 	  axis_out[i] =
Index: gdk/win32/gdkinput.c
===================================================================
RCS file: /cvs/gnome/gtk+/gdk/win32/gdkinput.c,v
retrieving revision 1.24.4.1
diff -u -r1.24.4.1 gdkinput.c
--- gdk/win32/gdkinput.c	2 Feb 2005 18:13:41 -0000	1.24.4.1
+++ gdk/win32/gdkinput.c	6 Mar 2005 19:26:34 -0000
@@ -422,7 +422,7 @@
 	      _gdk_input_disable_window (input_window->window, gdkdev);
 	}
     }
-  else if (mode == GDK_MODE_SCREEN)
+  else if (mode == GDK_MODE_SCREEN || mode == GDK_MODE_SCREEN_SYSCURSORPOS)
     {
       device->has_cursor = TRUE;
       for (tmp_list = _gdk_input_windows; tmp_list; tmp_list = tmp_list->next)
