From 7a0b226f5c25a309c8ff9f4e240f54b7d3b7eb37 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Wed, 17 May 2023 12:49:52 +0200 Subject: [PATCH] Fix for #10576 - Context menu doesn't show on right click of objects on Mac 2.6 Beta 1 --- src/slic3r/GUI/GUI_ObjectList.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 88e8f8691..65be4ba91 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -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)