discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSWindow resize quiestion


From: UBoss UBoss
Subject: Re: NSWindow resize quiestion
Date: Mon, 6 Feb 2006 08:10:06 +0000

Hi now i found that this bug, is in gnustep-back-0.9.0 .
I look in sources for back 0.10.2 and make some changes in our 0.9.0 now it works ok.

I must use 0.9.0 because we have some libraries whitch won't work on back 0.10.2 (now i'm creating the new one hoping it will work on back 0.10.2 :-)

Thanks for your explanaiton.

UBoss

here is repair: is in x11/XGServerEvent.m - receivedEvent - ConfigureNotify
old one
          /*
           * Get OpenStep frame coordinates from X frame.
           * If it's not from the window mmanager, ignore x and y.
           */
          r = cWin->xframe;
          if (xEvent.xconfigure.send_event == 0)
        {
          x = NSMakeRect(r.origin.x, r.origin.y,
                 xEvent.xconfigure.width, xEvent.xconfigure.height);
        }
        else ...


new one
               /*
           * Get OpenStep frame coordinates from X frame.
           * If it's not from the window mmanager, ignore x and y.
           */
     r = cWin->xframe;
     if (xEvent.xconfigure.send_event == 0)
        {
          int root_x,root_y;
          Window root_child;
          XTranslateCoordinates(dpy,xEvent.xconfigure.window,
              RootWindow(dpy,cWin->screen),
            0,0,&root_x,&root_y,&root_child);
          x = NSMakeRect(root_x, root_y,
                 xEvent.xconfigure.width, xEvent.xconfigure.height);
                 cWin->xframe.origin = x.origin;
        }
          else ....


On 2/3/06, Richard Frith-Macdonald <richard@brainstorm.co.uk> wrote:

On 3 Feb 2006, at 11:51, UBoss UBoss wrote:

> Hi
> I have folowing problem, when i resize the window with bottom left
> corner. Everything looks ok, but the frame (origin) has wrong
> coordinates.
> Mybe it's a bug in back in XGServerWidnow placeWindow

<snip>

> I think thath else if (move==YES) is wrong, because if i resize the
> widow using bottom left resize bar corner, the window resize and
> moves, but the frame origin position is not updated.
> Can you repair thsi bug or tell me why it's done in this way?

I'm not sure what your problem is ... but I'm guessing it's confusion
between two different window systems.

The origin of an NSWindow (ie a window in GNUstep/Openstep/MacOS-X)
is its bottom left corner and increasing Y-coordinates move up the
screen.
The origin of an X window is its bottom left corner, and increasing Y
coordinates move down the screen.

So if you resize using the bottom left corner the you have both a
move and a resize of the NSWindow ... this is handled by the 'if
(resize == YES)' case (which updates both size and origin).

The 'else if (move == YES)' case will only be executed if you move
the window without resizing it ... in this case we change the origin
but not the frame size.



reply via email to

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