mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-22 04:28:05 +08:00
Attempt to fix 3DScene key event on Linux
This commit is contained in:
parent
94d608c6c1
commit
2bccb43122
@ -1987,20 +1987,16 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
int selected_object_idx = (is_layers_editing_enabled() && (m_print != nullptr)) ? get_layers_editing_first_selected_object_id(m_print->objects.size()) : -1;
|
int selected_object_idx = (is_layers_editing_enabled() && (m_print != nullptr)) ? get_layers_editing_first_selected_object_id(m_print->objects.size()) : -1;
|
||||||
set_layers_editing_last_object_id(selected_object_idx);
|
set_layers_editing_last_object_id(selected_object_idx);
|
||||||
|
|
||||||
// set_mouse_dragging(false);
|
|
||||||
|
|
||||||
if (evt.Entering())
|
if (evt.Entering())
|
||||||
{
|
{
|
||||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
#if defined(__WXMSW__) || defined(__linux__)
|
||||||
// On Windows and Linux needs focus in order to catch key events
|
// On Windows and Linux needs focus in order to catch key events
|
||||||
m_canvas->SetFocus();
|
m_canvas->SetFocus();
|
||||||
m_drag.set_start_position_2D(Point(INT_MAX, INT_MAX));
|
m_drag.set_start_position_2D(Point(INT_MAX, INT_MAX));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else if (evt.LeftDClick())
|
else if (evt.LeftDClick())
|
||||||
{
|
|
||||||
m_on_double_click_callback.call();
|
m_on_double_click_callback.call();
|
||||||
}
|
|
||||||
else if (evt.LeftDown() || evt.RightDown())
|
else if (evt.LeftDown() || evt.RightDown())
|
||||||
{
|
{
|
||||||
// If user pressed left or right button we first check whether this happened
|
// If user pressed left or right button we first check whether this happened
|
||||||
@ -2197,9 +2193,7 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
|||||||
int vol_id = m_drag.get_volume_idx();
|
int vol_id = m_drag.get_volume_idx();
|
||||||
int group_id = m_volumes->volumes[vol_id]->drag_group_id;
|
int group_id = m_volumes->volumes[vol_id]->drag_group_id;
|
||||||
if (group_id == -1)
|
if (group_id == -1)
|
||||||
{
|
|
||||||
volume_idxs.push_back(vol_id);
|
volume_idxs.push_back(vol_id);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < m_volumes->volumes.size(); ++i)
|
for (int i = 0; i < m_volumes->volumes.size(); ++i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user