mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Ensuring that GLCanvas gets focus when it should (Linux only fix)
This commit is contained in:
parent
e172e26da2
commit
d7e14d0792
1 changed files with 10 additions and 8 deletions
|
@ -3110,15 +3110,17 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
|
||||||
|
|
||||||
void Plater::on_activate()
|
void Plater::on_activate()
|
||||||
{
|
{
|
||||||
|
#ifdef __linux__
|
||||||
wxWindow *focus_window = wxWindow::FindFocus();
|
wxWindow *focus_window = wxWindow::FindFocus();
|
||||||
if (focus_window == nullptr) {
|
// Activating the main frame, and no window has keyboard focus.
|
||||||
// Activating the main frame, and no window has keyboard focus.
|
// Set the keyboard focus to the visible Canvas3D.
|
||||||
// Set the keyboard focus to the visible Canvas3D.
|
if (this->p->view3D->IsShown() && (!focus_window || focus_window == this->p->view3D->get_wxglcanvas()))
|
||||||
if (this->p->view3D->IsShown())
|
this->p->view3D->get_wxglcanvas()->SetFocus();
|
||||||
this->p->view3D->get_wxglcanvas()->SetFocus();
|
|
||||||
else if (this->p->preview->IsShown())
|
else if (this->p->preview->IsShown() && (!focus_window || focus_window == this->p->view3D->get_wxglcanvas()))
|
||||||
this->p->preview->get_wxglcanvas()->SetFocus();
|
this->p->preview->get_wxglcanvas()->SetFocus();
|
||||||
}
|
#endif
|
||||||
|
|
||||||
if (! this->p->delayed_error_message.empty()) {
|
if (! this->p->delayed_error_message.empty()) {
|
||||||
std::string msg = std::move(this->p->delayed_error_message);
|
std::string msg = std::move(this->p->delayed_error_message);
|
||||||
this->p->delayed_error_message.clear();
|
this->p->delayed_error_message.clear();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue