gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error in [back] XGGLContext.m ???


From: Richard Frith-Macdonald
Subject: Re: Error in [back] XGGLContext.m ???
Date: Sun, 14 Jan 2007 17:05:10 +0000


On 14 Jan 2007, at 14:39, Xavier Glattard wrote:


Hello

I'm playing with NSOpenGLView (only with code : no Gorm) and my custom GLView is always shifted up- and rigth- ward, and it seems the amount of pixels depends on the window decoration (ie not the same with or without NSResizableWindowMask).

I got it fixed by changing line #83 in back/Source/x11/ XGGLContext.m, in
[XGXSubWindow-initWithView:]

   win_info = [XGServer _windowWithTag: [win windowNumber]];
   NSAssert(win_info, NSInternalInconsistencyException);

-   rect = [view convertRect: [view bounds] toView: nil];
+ rect = [view convertRect: [view bounds] toView: [[view window] contentView]];

I'm not sure that's the good way to fix that bug, and i'm not even sure it's
really a bug or an error in my own code...

It's a bug, and I think the fix is correct, but incomplete as behavior depends on whether the gui is doing window decorations or the window manager is doing them.
I've made a more complete fix to svn trunk ... you could check it out.

Why is an NSOpenGLView in Gorm ok ????

No idea I'm afraid.

As i was looking around i find a weird line #1423 in gui/Source/ NSView.m, in
static NSRect convert_rect_using_matrices(...)

   for (i = 0; i < 4; i++)
     p[i] = aRect.origin;
   p[1].x += aRect.size.width;
-  p[2].y += aRect.size.height;
+  p[1].y += aRect.size.height;
   p[3].x += aRect.size.width;
   p[3].y += aRect.size.height;

A typo ? Still not sure...

That code looks OK to me, not a typo ... looks like it sets p[0] to p [3] to be the points at the four corners of the rectangle.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]