Opened 5 years ago

Last modified 3 years ago

#15383 accepted defect

wxOwnerDrawnComboBox does not accept mouse clicks for item selection when used on a modal dialog in Cocoa

Reported by: LarryM Owned by: csomor
Priority: normal Milestone:
Component: wxOSX Version: 2.9.4
Keywords: wxOwnerDrawnComboBox Cc:
Blocked By: Blocking:
Patch: no


When a wxOwnerDrawnComboBox is created on a dialog and wxDialog::ShowModal() is used to show the dialog, clicking on the items in the popup list results only in beeps and no selection. The same works when the parent dialog is shown modelessly with wxDialog::Show().

Attachments (2) download (80.7 KB) - added by LarryM 5 years ago.
Simple XCode project demonstrating problem download (7.2 KB) - added by LarryM 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by LarryM

Simple XCode project demonstrating problem

Changed 5 years ago by LarryM


comment:1 Changed 5 years ago by LarryM

  • Patch set

It seems that the code in void wxNonOwnedWindowCocoaImpl::Create(wxWindow*, const wxPoint&, const wxSize&, long, long, const wxString&) was not correctly determining that the control's parent was a modal dialog and therefore not calling [NSPanel setWorksWhenModal]. It was only looking at this's parent, whereas the wxDialog was one level above the parent. I added logic to iterate upstream through the window's ancestors until a dialog is found.

comment:2 Changed 5 years ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

comment:3 Changed 5 years ago by SC

(In [74623]) follow up parent chain to properly support modal dialog parents, see #15383

comment:4 Changed 4 years ago by annakrat

This bug is still present in wxWidgets 3.0.0. Any update?

comment:5 Changed 3 years ago by vadz

  • Patch unset

It would be nice to have a simple way to reproduce the problem in a sample, if only to be able to check easily if it's still present or not.

I also believe that the original patch was already applied, so I'm clearing the "patch" checkbox.

Note: See TracTickets for help on using tickets.