Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build all
on:
push:
branches:
- main
- master
paths:
- 'deps/**'
- 'src/**'
Expand Down
16 changes: 13 additions & 3 deletions src/slic3r/GUI/MainFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,20 @@ wxDEFINE_EVENT(EVT_LOAD_PRINTER_URL, wxCommandEvent);

static bool is_text_entry_focused()
{
for (wxWindow *window = wxWindow::FindFocus(); window != nullptr; window = window->GetParent())
if (dynamic_cast<wxTextEntry *>(window) != nullptr)
wxWindow *focused = wxWindow::FindFocus();
// Walk up the parent chain — covers the common case where a native text
// control (wxTextCtrl) or a composite widget's inner text ctrl has focus.
for (wxWindow *w = focused; w != nullptr; w = w->GetParent())
if (dynamic_cast<wxTextEntry *>(w) != nullptr)
return true;

// Also check direct children of the focused window: on some platforms
// (e.g. Windows with custom TextInput panels) focus lands on the outer
// container while the inner wxTextCtrl is a direct child.
if (focused) {
for (wxWindowList::Node *node = focused->GetChildren().GetFirst(); node; node = node->GetNext())
if (dynamic_cast<wxTextEntry *>(node->GetData()) != nullptr)
return true;
}
return false;
}

Expand Down