summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--win/tkWinPointer.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c
index 96661ae..d62161f 100644
--- a/win/tkWinPointer.c
+++ b/win/tkWinPointer.c
@@ -409,6 +409,15 @@ TkpChangeFocus(winPtr, force)
if (winPtr->window == None) {
panic("ChangeXFocus got null X window");
}
+
+ /*
+ * Change the foreground window so the focus window is raised to the top of
+ * the system stacking order and gets the keyboard focus.
+ */
+
+ if (force) {
+ SetForegroundWindow(Tk_GetHWND(winPtr->window));
+ }
XSetInputFocus(dispPtr->display, winPtr->window, RevertToParent,
CurrentTime);