From 28b56ae840a4946b853323110f6113ee13d076fb Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 22 Oct 2012 16:03:08 +0200 Subject: [PATCH] Force unfocusing of all input fields when saving a preset, otherwise the currently focused one might be ignored. #750 #624 --- lib/Slic3r/GUI/Tab.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 69eab8820b..0a6eacab85 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -85,6 +85,12 @@ sub new { }); EVT_BUTTON($self, $self->{btn_save_preset}, sub { + + # since buttons (and choices too) don't get focus on Mac, we set focus manually + # to the treectrl so that the EVT_* events are fired for the input field having + # focus currently. is there anything better than this? + $self->{treectrl}->SetFocus; + my $preset = $self->current_preset; my $default_name = $preset->{default} ? 'Untitled' : basename($preset->{name}); $default_name =~ s/\.ini$//i;