Fix under OSX for 584b37513f

This commit is contained in:
YuSanka 2019-09-19 14:11:56 +02:00
parent 91311fc0a0
commit ddf37d3b01

View file

@ -794,15 +794,26 @@ void ObjectList::list_manipulation(bool evt_context_menu/* = false*/)
const wxPoint pt = get_mouse_position_in_control();
HitTest(pt, item, col);
/* Note: Under OSX right click doesn't send "selection changed" event.
* It means that Selection() will be return still previously selected item.
* Thus under OSX we should force UnselectAll(), when item and col are nullptr,
* and select new item otherwise.
*/
if (!item) {
if (col == nullptr)
return;
if (wxOSX && col == nullptr)
UnselectAll();
if (evt_context_menu) {
show_context_menu(evt_context_menu);
return;
}
}
if (wxOSX && item && col) {
UnselectAll();
Select(item);
}
const wxString title = col->GetTitle();
if (title == " ")