From: Václav Slavík Date: Thu, 16 Sep 2010 09:05:48 +0000 (+0000) Subject: Fix wxMSW rendering artifacts with modal dialogs. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/685ed4d1f8a834dd898d0897fa96d3a8b0468372 Fix wxMSW rendering artifacts with modal dialogs. When a modal dialog showed another modal dialog, parts of the parent window weren't refreshed correctly. This demonstrated itself as rendering artifacts when moving the child dialog to another position: parts of the dialog were shown as disabled, parts as enabled. Fixed by explicitly refreshing the window. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/msw/toplevel.h b/include/wx/msw/toplevel.h index fb242e68f7..52905cc32a 100644 --- a/include/wx/msw/toplevel.h +++ b/include/wx/msw/toplevel.h @@ -141,6 +141,8 @@ protected: virtual void DoFreeze(); virtual void DoThaw(); + virtual void DoEnable(bool enable); + // helper of SetIcons(): calls gets the icon with the size specified by the // given system metrics (SM_C{X|Y}[SM]ICON) from the bundle and sets it // using WM_SETICON with the specified wParam (ICOM_SMALL or ICON_BIG); diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index ba45599a81..87508df811 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -1279,6 +1279,17 @@ bool wxTopLevelWindowMSW::CanSetTransparent() return (os_type == wxOS_WINDOWS_NT && ver_major >= 5); } +void wxTopLevelWindowMSW::DoEnable(bool enable) +{ + wxTopLevelWindowBase::DoEnable(enable); + + // Enabling or disabling a window may change its appearance. Unfortunately, + // in at least some situation, toplevel windows don't repaint themselves, + // so we have to issue explicit refresh to avoid rendering artifacts. + // + // TODO: find out just what exactly is wrong here + Refresh(); +} void wxTopLevelWindowMSW::DoFreeze() {