[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #17377] Various frame related methods in NSWindow return wrong resu
From: |
Quentin Mathé |
Subject: |
[bug #17377] Various frame related methods in NSWindow return wrong results |
Date: |
Wed, 16 Aug 2006 09:07:37 +0000 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; fr) AppleWebKit/418.8 (KHTML, like Gecko) Safari/419.3 |
Follow-up Comment #6, bug #17377 (project gnustep):
I finally found Alexander's documentation in NSWindow.h:
/*
A window really has three interesting frames:
The screen frame. This is the frame of the _entire_ window on the screen,
including all decorations and borders (regardless of where they come
from).
(On X, we can only guess what the screen frame is.)
The window frame. This is the frame of the backend window for this window,
and is thus the base of the coordinate system for the window. IOW, it's
the frame of the area we can draw into.
The contect rect. This is the frame of the content view.
Wrt. size, ScreenFrame >= WindowFrame >= ContentRect. When -gui doesn't
manage the window decorations, WindowFrame == ContentRect. When -gui does
manage the window decorations, WindowFrame will include the decorations,
and ScreenFrame == WindowFrame.
To get coordinate transforms and stuff right wrt. OpenStep, we really want
the window frame here.
For hysterical reasons, _frame used to be the screen frame. However, the
resulting inconsistencies caused a bunch of problems. Thus, _frame is the
window frame. The other rectangles/sizes passed around in NSWindow
methods are supposed to all be window frames.
*/
The last paragraph makes sense at implementation level, but not at API level
since it breaks OpenStep/Cocoa compatibility and prevents precise layout of
the windows on screen.
To summarize:
frameRect is returned by [window frame]
contentRect is returned by [[window contentView] frame] (not sure this
returns the proper value on GNUstep)
- screenRect == frameRect on Cocoa/OpenStep
- frameRect == contentRect on Cocoa/OpenStep
- windowFrame == frameRect or contentRect (since it represents the frame
manipulated in the backend)
windowFrame is a specially confusing term taking in account it can be either
screenRect or contentRect. I found screenRect quite confusing to since there
is an NSScreen class in AppKit.
Quentin.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?17377>
_______________________________________________
Message posté via/par Savannah
http://savannah.gnu.org/
- [bug #17377] Various frame related methods in NSWindow return wrong results, Quentin Mathé, 2006/08/08
- [bug #17377] Various frame related methods in NSWindow return wrong results, Fred Kiefer, 2006/08/09
- [bug #17377] Various frame related methods in NSWindow return wrong results, Quentin Mathé, 2006/08/09
- [bug #17377] Various frame related methods in NSWindow return wrong results, Quentin Mathé, 2006/08/09
- [bug #17377] Various frame related methods in NSWindow return wrong results, Gregory John Casamento, 2006/08/09
- [bug #17377] Various frame related methods in NSWindow return wrong results, Fred Kiefer, 2006/08/11
- Re: [bug #17377] Various frame related methods in NSWindow return wrong results, Richard Frith-Macdonald, 2006/08/15
- Re: [bug #17377] Various frame related methods in NSWindow return wrong results, Quentin Mathé, 2006/08/16
- [bug #17377] Various frame related methods in NSWindow return wrong results,
Quentin Mathé <=
- [bug #17377] Various frame related methods in NSWindow return wrong results, Quentin Mathé, 2006/08/16