#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED

5 views
Skip to first unread message

wxTrac

unread,
Oct 11, 2012, 11:52:28 AM10/11/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
-------------------------------------------------+--------------------------
Reporter: andyr | Owner:
Type: defect | Status: new
Priority: normal | Milestone:
Component: wxOSX-Cocoa | Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------+--------------------------
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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739>

wxTrac

unread,
Oct 11, 2012, 6:36:55 PM10/11/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:1>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
-------------------------------------------------+--------------------------
Reporter: andyr | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 3.0
Component: wxOSX-Cocoa | Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------+--------------------------
Changes (by vadz):

* milestone: => 3.0


Comment:

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?


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:1>

wxTrac

unread,
Oct 12, 2012, 4:58:16 AM10/12/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:2>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
-------------------------------------------------+--------------------------
Reporter: andyr | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 3.0
Component: wxOSX-Cocoa | Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------+--------------------------

Comment(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?


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:2>

wxTrac

unread,
Oct 12, 2012, 6:31:44 PM10/12/12
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:3>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
-------------------------------------------------+--------------------------
Reporter: andyr | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 3.0
Component: wxOSX-Cocoa | Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------+--------------------------

Comment(by vadz):

Replying to [comment:2 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.


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:3>

wxTrac

unread,
Jun 1, 2013, 2:28:56 PM6/1/13
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:4>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
-------------------------------------------------+--------------------------
Reporter: andyr | Owner:
Type: defect | Status: new
Priority: normal | Milestone: 3.0
Component: wxOSX-Cocoa | Version:
Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED | Blockedby:
Patch: 0 | Blocking:
-------------------------------------------------+--------------------------

Comment(by SC):

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


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:4>

wxTrac

unread,
Jun 1, 2013, 2:30:40 PM6/1/13
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:5>

#14739: Mac Cocoa assert-fail, wxFD_FILE_MUST_EXIST==wxFRAME_SHAPED
--------------------------+-------------------------------------------------
Reporter: andyr | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: 3.0
Component: wxOSX-Cocoa | Version:
Resolution: fixed | Keywords: wxFD_FILE_MUST_EXIST wxFRAME_SHAPED
Blockedby: | Patch: 0
Blocking: |
--------------------------+-------------------------------------------------
Changes (by csomor):

* status: new => closed
* resolution: => fixed


Comment:

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


--
Ticket URL: <http://trac.wxwidgets.org/ticket/14739#comment:5>
Reply all
Reply to author
Forward
0 new messages