From 5d9ff677c085940a14a451132e3e014f328c2cee Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 25 Dec 2014 19:51:53 +0100 Subject: [PATCH] Workaround wxMSW not catching mouse wheel events if panel has no focus. #2424 --- lib/Slic3r/GUI/PreviewCanvas.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/PreviewCanvas.pm b/lib/Slic3r/GUI/PreviewCanvas.pm index 7ff0075acf..436854d36d 100644 --- a/lib/Slic3r/GUI/PreviewCanvas.pm +++ b/lib/Slic3r/GUI/PreviewCanvas.pm @@ -118,7 +118,10 @@ sub mouse_event { my ($self, $e) = @_; my $pos = Slic3r::Pointf->new($e->GetPositionXY); - if ($e->LeftDClick) { + if ($e->Entering && &Wx::wxMSW) { + # wxMSW needs focus in order to catch mouse wheel events + $self->SetFocus; + } elsif ($e->LeftDClick) { $self->on_double_click->() if $self->on_double_click; } elsif ($e->LeftDown || $e->RightDown) {