Windows: Make sure AWTInputAdapter is not reporting events twice after a grab change

This commit is contained in:
Elias Naur 2006-11-19 23:02:25 +00:00
parent 5d6ae4138a
commit d75d00666a
4 changed files with 86 additions and 20 deletions

View file

@ -115,9 +115,15 @@ final class WindowsAWTInput extends AbstractAWTInput {
private void grab(boolean grab) {
if (has_grabbed != grab) {
cached_mouse.grab(grab);
cached_keyboard.grab(grab);
has_grabbed = grab;
if (!grab)
cached_mouse.flush();
cached_keyboard.flush();
getMouseEventQueue().clearEvents();
getKeyboardEventQueue().clearEvents();
if (!grab) {
getCanvas().setCursor(cached_cursor);
}
}
}