< prev index next >

src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp

Print this page

        

@@ -92,16 +92,25 @@
             return (jint)0;
         }
         pointClass = (jclass)env->NewGlobalRef(pointClassLocal);
         env->DeleteLocalRef(pointClassLocal);
     }
+
+    int screen = AwtWin32GraphicsDevice::GetDefaultDeviceIndex();
+    Devices::InstanceAccess devices;
+    AwtWin32GraphicsDevice *device = devices->GetDevice(screen);
+
     xID = env->GetFieldID(pointClass, "x", "I");
     CHECK_NULL_RETURN(xID, (jint)0);
     yID = env->GetFieldID(pointClass, "y", "I");
     CHECK_NULL_RETURN(yID, (jint)0);
-    env->SetIntField(point, xID, pt.x);
-    env->SetIntField(point, yID, pt.y);
+
+    int x = (device == NULL) ? pt.x : device->ScaleDownX(pt.x);  
+    int y = (device == NULL) ? pt.y : device->ScaleDownY(pt.y);  
+
+    env->SetIntField(point, xID, x);
+    env->SetIntField(point, yID, y);
 
     // Always return 0 on Windows: we assume there's always a
     // virtual screen device used.
     return (jint)0;
 }
< prev index next >