From d4655020f96f7e3d9de9a994af63d5455c429ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Luzerio?= Date: Wed, 2 Mar 2016 07:50:32 +1100 Subject: [PATCH] Fix zoom issue on MSWin (wxCanvas requires focus) --- 3d-viewer/3d_cache/dialogs/panel_prev_model.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp index a43996e730..ede4187117 100644 --- a/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp +++ b/3d-viewer/3d_cache/dialogs/panel_prev_model.cpp @@ -508,12 +508,18 @@ void PANEL_PREV_3D::UpdateModelName( wxString const& aModelName ) preview->SetSizer( ws ); preview->Layout(); ws->FitInside( preview ); + + // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus + // in order to receive mouse events. Otherwise, the user has to click somewhere on + // the canvas before it will respond to mouse wheel events. + canvas->SetFocus(); return; } canvas->Set3DModel( *model ); canvas->Refresh(); canvas->Update(); + canvas->SetFocus(); return; }