#14739 closed defect (fixed)

Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED

Reported by: andyr Owned by:
Priority: normal Milestone: 3.0.0
Component: wxOSX-Cocoa Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED Cc:
Blocked By: Blocking:
Patch: no

Description

I'm actually using a snapshot from 2012-09-24

And as I say,
wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED==0x10

You can see this cause an assert in the dialogs sample as follows:

In MyApp:OnInit, add

wxSystemOptions::SetOption(wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES, 1);

And in FileOpen2, add the style wxFD_FILE_MUST_EXIST

It now asserts when you select Dialogs - File operations - Second open file.

This is caused by some drawing code thinking it is seeing the wxFRAME_SHAPED flag, tries to get the shape of the window, but it hasn't got one.

Change History (5)

comment:1 Changed 23 months ago by vadz

  • Milestone set to 3.0

I have no idea about how to fix this in any decent way :-( There doesn't seem to be any values that we could safely reuse for wxFD_FILE_MUST_EXIST.

Any ideas?

comment:2 follow-up: Changed 23 months ago by andyr

I changed wxFRAME_SHAPED to 0x1000000 and it seems to be working ok... have I missed something? Is there some reason why we must use 16 bit flags perhaps?

comment:3 in reply to: ↑ 2 Changed 23 months ago by vadz

Replying to andyr:

I changed wxFRAME_SHAPED to 0x1000000 and it seems to be working ok...

This is wxBORDER_STATIC and while making a shaped frame with this kind of border is a strange idea, it's still not obvious that it should be forbidden. And the fact that this style could be cleared by removing the bits in wxBORDER_MASK (which is done in a few places in the code) risks being a problem too, if not now, then in the future.

have I missed something? Is there some reason why we must use 16 bit flags perhaps?

We use the high 16 bits for class-independent styles and the low 16 ones for class-dependent ones. The trouble is that wxFrame uses too many of the latter.

comment:4 Changed 15 months ago by SC

(In [74075]) only set native window level, when not using a wrapped native window, see #14739

comment:5 Changed 15 months ago by csomor

  • Resolution set to fixed
  • Status changed from new to closed

should be working now correctly (r74076 is needed as well)

Note: See TracTickets for help on using tickets.