|
From: <ka...@us...> - 2010-10-28 21:40:01
|
Revision: 3453
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3453&view=rev
Author: kappa1
Date: 2010-10-28 21:39:55 +0000 (Thu, 28 Oct 2010)
Log Message:
-----------
Implement preliminary support for Display.isInsideWindow() on linux
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java
trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2010-10-28 16:03:04 UTC (rev 3452)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2010-10-28 21:39:55 UTC (rev 3453)
@@ -136,7 +136,8 @@
private long parent_window;
private boolean xembedded;
private boolean parent_focus;
-
+ private boolean mouseInside = true;
+
private LinuxKeyboard keyboard;
private LinuxMouse mouse;
@@ -777,6 +778,12 @@
case LinuxEvent.Expose:
dirty = true;
break;
+ case LinuxEvent.EnterNotify:
+ mouseInside = true;
+ break;
+ case LinuxEvent.LeaveNotify:
+ mouseInside = false;
+ break;
default:
break;
}
@@ -1248,9 +1255,9 @@
return Display.getDisplayMode().getHeight();
}
- public boolean isInsideWindow() {
- return true;
- }
+ public boolean isInsideWindow() {
+ return mouseInside;
+ }
/**
* Helper class for managing Compiz's workarounds. We need this to enable Legacy
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2010-10-28 16:03:04 UTC (rev 3452)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxEvent.java 2010-10-28 21:39:55 UTC (rev 3453)
@@ -46,12 +46,14 @@
public static final int KeyPress = 2;
public static final int KeyRelease = 3;
public static final int ButtonPress = 4;
- public static final int ButtonRelease = 5;
- public static final int MotionNotify = 6;
+ public static final int ButtonRelease = 5;
+ public static final int MotionNotify = 6;
+ public static final int EnterNotify = 7;
+ public static final int LeaveNotify = 8;
public static final int UnmapNotify = 18;
public static final int MapNotify = 19;
public static final int Expose = 12;
- public static final int ClientMessage = 33;
+ public static final int ClientMessage = 33;
private final ByteBuffer event_buffer;
Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c
===================================================================
--- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2010-10-28 16:03:04 UTC (rev 3452)
+++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2010-10-28 21:39:55 UTC (rev 3453)
@@ -307,7 +307,7 @@
cmap = XCreateColormap(disp, parent, vis_info->visual, AllocNone);
attribs.colormap = cmap;
attribs.border_pixel = 0;
- attribs.event_mask = ExposureMask | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask;
+ attribs.event_mask = ExposureMask | FocusChangeMask | VisibilityChangeMask | StructureNotifyMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask| EnterWindowMask | LeaveWindowMask;
attribmask = CWColormap | CWEventMask | CWBorderPixel;
if (isLegacyFullscreen(window_mode)) {
attribmask |= CWOverrideRedirect;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|