Linux: Moved input focus handling to LinuxDisplay. Bumped Sys.JNI_VERSION

This commit is contained in:
Elias Naur 2008-04-09 18:44:25 +00:00
parent 1a9bed90ed
commit ab4bb1ebcb
3 changed files with 3 additions and 3 deletions

View File

@ -57,7 +57,7 @@ public final class Sys {
private static final String VERSION = "2.0a3";
/** Current version of the JNI library */
static final int JNI_VERSION = 13;
static final int JNI_VERSION = 15;
/** The implementation instance to delegate platform specific behavior to */
private final static SysImplementation implementation;

View File

@ -627,6 +627,8 @@ final class LinuxDisplay implements DisplayImplementation {
while (LinuxEvent.getPending(getDisplay()) > 0) {
event_buffer.nextEvent(getDisplay());
long event_window = event_buffer.getWindow();
if (event_buffer.getType() == LinuxEvent.ButtonPress && parent != null)
setInputFocus(getDisplay(), getWindow(), event_buffer.getButtonTime());
if (event_window != getWindow() || event_buffer.filterEvent(event_window) ||
(mouse != null && mouse.filterEvent(grab, shouldWarpPointer(), event_buffer)) ||
(keyboard != null && keyboard.filterEvent(event_buffer)))

View File

@ -280,8 +280,6 @@ final class LinuxMouse {
case LinuxEvent.ButtonPress: /* Fall through */
case LinuxEvent.ButtonRelease:
handleButtonEvent(grab, event.getButtonTime(), event.getButtonType(), (byte)event.getButtonButton());
if (Display.getParent() != null)
LinuxDisplay.setInputFocus(display, window, event.getButtonTime());
return true;
case LinuxEvent.MotionNotify:
handlePointerMotion(grab, warp_pointer, event.getButtonTime(), event.getButtonRoot(), event.getButtonXRoot(), event.getButtonYRoot(), event.getButtonX(), event.getButtonY());