From 0fa00b51599bc2adda8b22b0f1d33da126d41359 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 25 Jun 2018 15:49:50 +0200 Subject: [PATCH] Don't do anything when ScrollWindow(0, 0) is called in wxMSW This doesn't really change anything, but just skips executing some code uselessly if we know in advance we are not going to do anything, which is nice as ScrollWindow() actually ends up being called with 0 arguments surprisingly often from wxScrollHelperBase::SetScrollRate(). This is also consistent with what wxGTK does. --- src/msw/window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8c3c961446..434927ecaf 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1144,6 +1144,9 @@ void wxWindowMSW::SetScrollbar(int orient, void wxWindowMSW::ScrollWindow(int dx, int dy, const wxRect *prect) { + if ( !dx && !dy ) + return; + RECT rect; RECT *pr; if ( prect )