From ddf37d3b01d8c19dc004a423b25c18ab1f7cddc4 Mon Sep 17 00:00:00 2001 From: YuSanka Date: Thu, 19 Sep 2019 14:11:56 +0200 Subject: [PATCH] Fix under OSX for https://github.com/prusa3d/PrusaSlicer/commit/584b37513f54d625f0f3a7490cd63ce48f83a95f --- src/slic3r/GUI/GUI_ObjectList.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 116f99eb80..47be4b5eb3 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -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 == " ")