Opened 15 months ago

Last modified 4 months 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-Cocoa Version: 2.9.4
Keywords: wxOwnerDrawnComboBox Cc:
Blocked By: Blocking:
Patch: yes

Description

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)

wxCocoaTestExample.zip download (80.7 KB) - added by LarryM 15 months ago.
Simple XCode project demonstrating problem
nonownedwnd.mm.zip download (7.2 KB) - added by LarryM 15 months ago.
Corrected nonownedwnd.mm

Download all attachments as: .zip

Change History (6)

Changed 15 months ago by LarryM

Simple XCode project demonstrating problem

Changed 15 months ago by LarryM

Corrected nonownedwnd.mm

comment:1 Changed 15 months 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 15 months ago by csomor

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

comment:3 Changed 15 months ago by SC

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

comment:4 Changed 4 months ago by annakrat

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

Note: See TracTickets for help on using tickets.