Preserve focus when window is minimized and restored in wxMSW.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Feb 2012 14:18:28 +0000 (14:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 5 Feb 2012 14:18:28 +0000 (14:18 +0000)
commit0c6dff03708fdc2d310f412cbc3cb7b705bc943e
tree507847c4da911eab934ce855c77293e239fdddd6
parent7e083675342b17762735ef2223fb9d264d6fc937
Preserve focus when window is minimized and restored in wxMSW.

Add specific code to save and restore the focus when the window is minimized
and restored in wxMSW as the existing code in WM_ACTIVATE handler wasn't
enough because this event was generated too late when minimizing the window
(when it was already minimized and so the focus had been already lost) and too
early when restoring it (so the window was still minimized and restoring focus
failed).

This is still not perfect as we do in our code something Windows would be
expected to do automatically but for whatever reason, it doesn't do it for
wxWidgets programs, and this manual workaround at least prevents the annoying
total focus loss.

Closes #1599.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70513 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
include/wx/msw/toplevel.h
src/msw/toplevel.cpp