Implement preliminary support for Display.isInsideWindow() on linux
This commit is contained in:
parent
7f839f2fe7
commit
84f28884c5
|
@ -136,7 +136,8 @@ final class LinuxDisplay implements DisplayImplementation {
|
|||
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 @@ final class LinuxDisplay implements DisplayImplementation {
|
|||
case LinuxEvent.Expose:
|
||||
dirty = true;
|
||||
break;
|
||||
case LinuxEvent.EnterNotify:
|
||||
mouseInside = true;
|
||||
break;
|
||||
case LinuxEvent.LeaveNotify:
|
||||
mouseInside = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1248,9 +1255,9 @@ final class LinuxDisplay implements DisplayImplementation {
|
|||
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
|
||||
|
|
|
@ -46,12 +46,14 @@ final class LinuxEvent {
|
|||
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;
|
||||
|
||||
|
|
|
@ -307,7 +307,7 @@ static Window createWindow(JNIEnv* env, Display *disp, int screen, jint window_m
|
|||
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;
|
||||
|
|
Loading…
Reference in New Issue