mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 00:32:05 +02:00
fix a regresion that the "search in preset" popup dialog will dismiss itself when move the cursor out of the dialog.
The regression is casued by 382cf57166 ("Fix hotkeys blocked in Prepare view when notification is shown")
This commit is contained in:
@@ -79,6 +79,13 @@
|
||||
|
||||
#include <imguizmo/ImGuizmo.h>
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#if wxUSE_POPUPWIN
|
||||
#include <wx/popupwin.h>
|
||||
extern wxPopupWindow* wxCurrentPopupWindow;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static constexpr const float TRACKBALLSIZE = 0.8f;
|
||||
|
||||
static Slic3r::ColorRGBA DEFAULT_BG_LIGHT_COLOR = { 0.906f, 0.906f, 0.906f, 1.0f };
|
||||
@@ -4258,14 +4265,21 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||
if (evt.Entering()) {
|
||||
// Set focus in order to remove it from sidebar fields and ensure hotkeys work
|
||||
if (m_canvas != nullptr) {
|
||||
// Only set focus if the top level window of this canvas is active.
|
||||
auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
|
||||
while (p->GetParent())
|
||||
p = p->GetParent();
|
||||
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
|
||||
//Orca: Set focus so hotkeys like 'tab' work when a notification is shown.
|
||||
if (top_level_wnd != nullptr && top_level_wnd->IsActive())
|
||||
m_canvas->SetFocus();
|
||||
#if defined(__WXMSW__) && wxUSE_POPUPWIN
|
||||
// Don't steal focus when a popup window is active (e.g., search dropdown).
|
||||
// Stealing focus triggers MSWDismissUnfocusedPopup, closing the popup unexpectedly.
|
||||
if (!wxCurrentPopupWindow)
|
||||
#endif
|
||||
{
|
||||
// Only set focus if the top level window of this canvas is active.
|
||||
auto p = dynamic_cast<wxWindow*>(evt.GetEventObject());
|
||||
while (p->GetParent())
|
||||
p = p->GetParent();
|
||||
auto *top_level_wnd = dynamic_cast<wxTopLevelWindow*>(p);
|
||||
//Orca: Set focus so hotkeys like 'tab' work when a notification is shown.
|
||||
if (top_level_wnd != nullptr && top_level_wnd->IsActive())
|
||||
m_canvas->SetFocus();
|
||||
}
|
||||
m_mouse.position = pos.cast<double>();
|
||||
m_tooltip_enabled = false;
|
||||
// 1) forces a frame render to ensure that m_hover_volume_idxs is updated even when the user right clicks while
|
||||
|
||||
Reference in New Issue
Block a user