Fix for grabbed mouse deltas.

This commit is contained in:
Ioannis Tsakpinis 2010-04-01 15:05:32 +00:00
parent 6998610cce
commit b31603f219
1 changed files with 2 additions and 4 deletions

View File

@ -542,19 +542,17 @@ final class WindowsDisplay implements DisplayImplementation {
if (getForegroundWindow() != hwnd && !hasParent)
return;
getGlobalClientRect(hwnd, rect);
/* -- This is wrong on multi-monitor setups
int local_offset_x = rect.left;
int local_offset_y = rect.top;
/* -- This is wrong on multi-monitor setups
getGlobalClientRect(getDesktopWindow(), rect2);
Rect.intersect(rect, rect2, rect);
*/
int center_x = (rect.left + rect.right)/2;
int center_y = (rect.top + rect.bottom)/2;
nSetCursorPosition(center_x, center_y);
int local_x = center_x - local_offset_x;
int local_y = center_y - local_offset_y;
*/
int local_x = (rect.right - rect.left) / 2;
int local_y = (rect.bottom - rect.top) / 2;
if (current_display != null)
current_display.setMousePosition(local_x, transformY(hwnd, local_y));
}