Hi,

I propose a change to replace obsolete code in salframe :

-> NewRgn(), DisposeRgn() , are deprecated .

See attached patch.

To apply it, put it in vcl/aqua/source/window, and do  : 

patch -p0 --dry-run <aqua_newrgn.diff

to see if nothing is wrong

then, to apply it really, do :

patch -p0 <aqua_newrgn.diff


Additional comments :


The new code does use GetWindowBounds() with kWindowContentRegion parameter


  Rect portBounds;
    GetWindowBounds (pSalFrame->mrWindow,  kWindowContentRgn, &portBounds );

SalPaintEvent aPaintEvt;
aPaintEvt.mnBoundX = 0;
aPaintEvt.mnBoundY = 0;
aPaintEvt.mnBoundWidth = portBounds.right - portBounds.left;
aPaintEvt.mnBoundHeight =portBounds.bottom - portBounds.top;

Rect  is a structure defining the size and location of a QuickDraw rectangle, but is not deprecated

If you read the patch, you'll se I have set aPaintEvent.mnBoundX and aPaintEvent.mnBoundY to be 0 instead of portBounds.left ( and right, repsectively )

The reason is GetWindowBounds will draw from locale coodrinates ( in the window ), with origin 0,0 + height  and width of the window.

Continue to use 

aPaintEvt.mnBoundX = portBounds.left;
aPaintEvt.mnBoundY = portBounds.top;


Will lead to funky effects, since portBounds.left and portBounds.top are global coordinates.  

A simple test to verify can be done :

1) keep portBounds.left , and portBounds.top 

2) For the different cases described below, try to create a new document, using the icon, on left -> will open (and ask to draw) a new window, our  rectangle 
 
2.1) main window is on left (borders of the window on left 

2.2) main window centered

2.3) all situations between the two previous one


In the first case, it should work, in the second, you'll obtain an empty area + all possibilities between them :)


Thanks in advance for your tests and your feedback !


Eric Bachard


Attachment: aqua_newrgn.diff
Description: Binary data

Reply via email to