Opened 12 years ago

Closed 4 years ago

#2722 closed defect (fixed)

MacSetMetalAppearance alters window size and position

Reported by: forestfield Owned by: csomor
Priority: normal Milestone:
Component: old wxOSX/Carbon port Version:
Keywords: Cc: forestfield, csomor, ghazel, hockkn
Blocked By: Blocking:
Patch: no


Using wxPython with OS X 10.4.2

After applying MacSetMetalAppearance to my main window,
both the position and the size of the window change by

5 to 10 pixels, for example:

as reported by .GetPositionTuple() -

Before: (13, 51) After: (8, 51)

as reported by .GetSizeTuple() -

Before: (1201, 768) After: (1211, 773)


David Hughes

Change History (6)

comment:1 Changed 12 years ago by ghazel

I have noticed this as well, and it seems to be fairly benign
(although unexpected and undocumented) except with
where the window is offset incorrectly.

comment:2 Changed 12 years ago by hockkn

I save and restore window positions between sessions and
don't notice the window moving across the screen after
repeated sessions--so perhaps the shift is just due to the
different appearance? ghazel, is that what you are asserting?

comment:3 Changed 12 years ago by ghazel

I tried out saving and restoring window positions. The effect
you will see is that the window grows by 5px on the left, right
and bottom each time, as David Hughes indicated.


wxPoint pos(50,50);
wxSize size(200,200);
wxFrame *mframe = new wxFrame();
mframe->SetExtraStyle(mframe->GetExtraStyle() |


mframe->Create(NULL, wxID_ANY, _(""), pos, size,


assert(mframe->GetPosition() == pos);
assert(mframe->GetSize() == size);

Will assert, so a store and recall of those settings would
cause it to grow. Of course without setting the metal style, it
does not assert.
The benign behaviour I mentioned is that between the two
styles a static window size and position allows properly
placed and identically sized contents. Looking back on that,
it's probably better to honor the requested size and position of
the metal window, and shrink the contents, as happens with
all the panel border styles.

comment:4 Changed 9 years ago by wxsite

  • Status changed from assigned to confirmed

transitioning old 'assigned' status to new 'confirmed' status

comment:5 Changed 4 years ago by oneeyeman

This is no longer the case. I applied the code from the comment #3 to the minimal sample and it didn't assert.

Tested on the Cocoa build against 10.6 SDK.

Can be closed.

comment:6 Changed 4 years ago by vadz

  • Resolution set to fixed
  • Status changed from confirmed to closed
Note: See TracTickets for help on using tickets.