From 79be13438ebc73fe2677c862e7c9b194eab97784 Mon Sep 17 00:00:00 2001 From: YuSanka <yusanka@gmail.com> Date: Fri, 13 Mar 2020 23:22:09 +0100 Subject: [PATCH] Fixed context menu issues, related to #3802 fixed with commit (https://github.com/prusa3d/PrusaSlicer/commit/4ca03c3f8a7d0013c65197c5b93b81c95c9d72f6) The code which caused an impossibility to edit objects in list under OSX using mouse right click, is deleted --- src/slic3r/GUI/GUI_ObjectList.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index 5ac22e54a..1a3955b0f 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -794,12 +794,6 @@ void ObjectList::OnContextMenu(wxDataViewEvent& evt) // The mouse position returned by get_mouse_position_in_control() here is the one at the time the mouse button is released (mouse up event) wxPoint mouse_pos = get_mouse_position_in_control(); - // We check if the mouse down event was over the "Editing" column, if not, we change the mouse position so that the following call to list_simulation() does not show any context menu - // see: https://github.com/prusa3d/PrusaSlicer/issues/3802 - wxDataViewColumn* column = evt.GetDataViewColumn(); - if (column == nullptr || column->GetTitle() != _("Editing")) - mouse_pos.x = 0; - // Do not show the context menu if the user pressed the right mouse button on the 3D scene and released it on the objects list GLCanvas3D* canvas = wxGetApp().plater()->canvas3D(); bool evt_context_menu = (canvas != nullptr) ? !canvas->is_mouse_dragging() : true; @@ -811,6 +805,12 @@ void ObjectList::OnContextMenu(wxDataViewEvent& evt) void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_menu/* = false*/) { + // Interesting fact: when mouse_pos.x < 0, HitTest(mouse_pos, item, col) returns item = null, but column = last column. + // So, when mouse was moved to scene immediately after clicking in ObjectList, in the scene will be shown context menu for the Editing column. + // see: https://github.com/prusa3d/PrusaSlicer/issues/3802 + if (mouse_pos.x < 0) + return; + wxDataViewItem item; wxDataViewColumn* col = nullptr; HitTest(mouse_pos, item, col);