diff --git a/ChangeLog b/ChangeLog index 412c537..1ffdbfe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-04 Xavier Glattard + + * Source/x11/XGServerEvent.m, + * Source/x11/XGGLContext.m, + * Source/x11/XGGLFormat.m: + Fix typo and oversights - Comes along with the previous changes. + 2009-03-04 Xavier Glattard * Source/x11/XGGLContext.m, diff --git a/Source/x11/XGGLContext.m b/Source/x11/XGGLContext.m index 5adee16..b4dde7d 100644 --- a/Source/x11/XGGLContext.m +++ b/Source/x11/XGGLContext.m @@ -90,7 +90,24 @@ win_info = [XGServer _windowWithTag: [window windowNumber]]; NSAssert(win_info, NSInternalInconsistencyException); - rect = [view convertRect: [view bounds] toView: nil]; + if ([server handlesWindowDecorations] == YES) + { + /* The window manager handles window decorations, so the + * the parent X window is equal to the content view and + * we must therefore use content view coordinates. + */ + rect = [view convertRect: [view bounds] + toView: [window contentView]]; + } + else + { + /* The GUI library handles window decorations, so the + * the parent X window is equal to the NSWindow frame + * and we can use window base coordinates. + */ + rect = [view convertRect: [view bounds] toView: nil]; + } + x = NSMinX(rect); y = NSHeight(win_info->xframe) - NSMaxY(rect); width = NSWidth(rect); diff --git a/Source/x11/XGGLFormat.m b/Source/x11/XGGLFormat.m index e1eecc1..cc4f0f5 100644 --- a/Source/x11/XGGLFormat.m +++ b/Source/x11/XGGLFormat.m @@ -67,7 +67,10 @@ } else { - glXGetConfig(dpy, configurations.visualinfo, attrib, vals); + error = glXGetConfig(dpy, configurations.visualinfo, attrib, vals); + if ( error != 0 ) + NSDebugMLLog( @"GLX", @"Can not get FB attribute for pixel format %@ - Errror %u", + self, error ); if ( error != 0 ) NSDebugMLLog( @"GLX", @"Can not get FB attribute for pixel format %@ - Errror %u", self, error ); @@ -175,12 +178,13 @@ break; } break; + case NSOpenGLPFAWindow: + drawable_type |= GLX_WINDOW_BIT; + break; case NSOpenGLPFAPixelBuffer: - ptr++; drawable_type |= GLX_PBUFFER_BIT; break; case NSOpenGLPFAOffScreen: - ptr++; drawable_type |= GLX_PIXMAP_BIT; break; @@ -202,7 +206,6 @@ case NSOpenGLPFARobust: case NSOpenGLPFABackingStore: case NSOpenGLPFAMPSafe: - case NSOpenGLPFAWindow: case NSOpenGLPFAMultiScreen: case NSOpenGLPFACompliant: case NSOpenGLPFAScreenMask: @@ -220,8 +223,9 @@ if ( drawable_type ) { - //append(GLX_DRAWABLE_TYPE,drawable_type); + append(GLX_DRAWABLE_TYPE,drawable_type); } + append1(None); //FIXME, what screen number ? diff --git a/Source/x11/XGServerEvent.m b/Source/x11/XGServerEvent.m index ea9ba32..1cc8842 100644 --- a/Source/x11/XGServerEvent.m +++ b/Source/x11/XGServerEvent.m @@ -979,7 +979,7 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) generic.cachedWindow = [XGServer _windowForXWindow:xw]; } - if ( xw == xEvent.xexpose.window ) + if ( xw != xEvent.xexpose.window ) { isSubWindow = YES; } @@ -989,7 +989,7 @@ static int check_modifier (XEvent *xEvent, KeySym key_sym) { XRectangle rectangle; - if ( isSubWindow ) + if ( !isSubWindow ) { rectangle.x = xEvent.xexpose.x; rectangle.y = xEvent.xexpose.y;