Fix for #10576 - Context menu doesn't show on right click of objects on Mac 2.6 Beta 1

This commit is contained in:
YuSanka 2023-05-17 12:49:52 +02:00 committed by Oleksandra Yushchenko
parent 32d72cceed
commit 7a0b226f5c

View File

@ -955,7 +955,7 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
if (!item) {
if (col == nullptr) {
if (wxOSX && !multiple_selection())
if (wxOSX)
UnselectAll();
else if (!evt_context_menu)
// Case, when last item was deleted and under GTK was called wxEVT_DATAVIEW_SELECTION_CHANGED,
@ -972,11 +972,17 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
if (wxOSX && item && col) {
wxDataViewItemArray sels;
GetSelections(sels);
UnselectAll();
if (sels.Count() > 1)
SetSelections(sels);
else
bool is_selection_changed = true;
for (const auto& sel_item : sels)
if (sel_item == item) {
// item is one oth the already selected items, so resection is no needed
is_selection_changed = false;
break;
}
if (is_selection_changed) {
UnselectAll();
Select(item);
}
}
if (col != nullptr)