summaryrefslogtreecommitdiff
path: root/wx+/focus.h
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-10-02 14:42:30 -0400
committerB Stack <bgstack15@gmail.com>2020-10-02 14:42:30 -0400
commit8aaf029ab6046eb8cbe600a548d176c1418bd99a (patch)
treed8a89392817379e3036c42eedebf33d4fb372dfd /wx+/focus.h
parentMerge branch '11.1' into 'master' (diff)
downloadFreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.gz
FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.tar.bz2
FreeFileSync-8aaf029ab6046eb8cbe600a548d176c1418bd99a.zip
add upstream 11.2
Diffstat (limited to 'wx+/focus.h')
-rw-r--r--wx+/focus.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/wx+/focus.h b/wx+/focus.h
index 297d0754..2920828f 100644
--- a/wx+/focus.h
+++ b/wx+/focus.h
@@ -45,15 +45,14 @@ wxTopLevelWindow* getTopLevelWindow(wxWindow* child)
}
-/*
-Preserving input focus has to be more clever than:
- wxWindow* oldFocus = wxWindow::FindFocus();
- ZEN_ON_SCOPE_EXIT(if (oldFocus) oldFocus->SetFocus());
+/* Preserving input focus has to be more clever than:
+ wxWindow* oldFocus = wxWindow::FindFocus();
+ ZEN_ON_SCOPE_EXIT(if (oldFocus) oldFocus->SetFocus());
=> wxWindow::SetFocus() internally calls Win32 ::SetFocus, which calls ::SetActiveWindow, which - lord knows why - changes the foreground window to the focus window
even if the user is currently busy using a different app! More curiosity: this foreground focus stealing happens only during the *first* SetFocus() after app start!
- It also can be avoided by changing focus back and forth with some other app after start => wxWidgets bug or Win32 feature???
-*/
+ It also can be avoided by changing focus back and forth with some other app after start => wxWidgets bug or Win32 feature??? */
+
struct FocusPreserver
{
FocusPreserver()
bgstack15