< prev index next >
src/java.desktop/windows/native/libawt/windows/MouseInfo.cpp
Print this page
*** 92,107 ****
return (jint)0;
}
pointClass = (jclass)env->NewGlobalRef(pointClassLocal);
env->DeleteLocalRef(pointClassLocal);
}
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);
// Always return 0 on Windows: we assume there's always a
// virtual screen device used.
return (jint)0;
}
--- 92,116 ----
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);
!
! 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 >