summaryrefslogtreecommitdiffstats
path: root/src/newt/native/X11Window.c
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2010-10-06 16:04:06 +0200
committerSven Gothel <[email protected]>2010-10-06 16:04:06 +0200
commit018c7e8660dc0af68bd129be9af5094d04d0b431 (patch)
treeac17156a48167f4a28e129adfc78b7c746aa6744 /src/newt/native/X11Window.c
parent03416ffe040d50b96573930104a78933605ae40d (diff)
NativeWindow/NativeSurface Refactoring ; Added mouseClick NEWT/AWT unit test
NativeWindow/NativeSurface Refactoring - Using NativeSurface interface - NativeWindow extends NativeSurface, adds getLocationOnScreen(Point) - NativeWindow add: getParent() - NativeWindow/Surface: Removed 'invalidate()', use 'destroy()' if you must. - NullWindow -> ProxySurface impl NativeSurface - JOGL: Uses NativeSurface only. - GLDrawable.getNativeWindow() -> GLDrawable.getNativeSurface() Added mouseClick NEWT/AWT unit test JOGL: - GLAnimatorControl add: resetCounter() - NEWT: - GLWindow counters: return GLWindow counters always - WindowImpl - requestFocus() wait until done - reparent: readded requestFocusImpl(true), native impl skips java focusAction if reparented - X11Window: Add XRaiseWindow() in requestFocus()
Diffstat (limited to 'src/newt/native/X11Window.c')
-rw-r--r--src/newt/native/X11Window.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/newt/native/X11Window.c b/src/newt/native/X11Window.c
index 350a0a704..8a07067b7 100644
--- a/src/newt/native/X11Window.c
+++ b/src/newt/native/X11Window.c
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ * Copyright (c) 2010 JogAmp Community. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -399,11 +400,12 @@ static void NewtWindows_requestFocus (JNIEnv *env, jobject window, Display *dpy,
Window focus_return;
int revert_to_return;
- XGetWindowAttributes(dpy, w, &xwa);
XGetInputFocus(dpy, &focus_return, &revert_to_return);
if(reparented || focus_return!=w) {
- // Avoid 'BadMatch' errors from XSetInputFocus, ie if window is not viewable
- if( JNI_FALSE == (*env)->CallBooleanMethod(env, window, focusActionID) ) {
+ if( reparented || JNI_FALSE == (*env)->CallBooleanMethod(env, window, focusActionID) ) {
+ XRaiseWindow(dpy, w);
+ // Avoid 'BadMatch' errors from XSetInputFocus, ie if window is not viewable
+ XGetWindowAttributes(dpy, w, &xwa);
if(xwa.map_state == IsViewable) {
XSetInputFocus(dpy, w, RevertToParent, CurrentTime);
}