Skip to content

Commit

Permalink
user32-dialog_focus: Add patchset.
Browse files Browse the repository at this point in the history
  • Loading branch information
zfigura committed Dec 8, 2018
1 parent 4912f27 commit 0121326
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
@@ -0,0 +1,35 @@
From 1e118030e5b1da7bbfa4c03548b15beb137497f5 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 6 Dec 2018 15:01:54 +1100
Subject: [PATCH] user32: Dont reset focus if current control is a child of our
parent

---
dlls/user32/dialog.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/dlls/user32/dialog.c b/dlls/user32/dialog.c
index 0b33a57..0d98d0a 100644
--- a/dlls/user32/dialog.c
+++ b/dlls/user32/dialog.c
@@ -692,7 +692,16 @@ static HWND DIALOG_CreateIndirect( HINSTANCE hInst, LPCVOID dlgTemplate,
SetFocus( focus );
}
else
- SetFocus( hwnd );
+ {
+ if (template.style & WS_CHILD)
+ {
+ HWND hParent = GetParent(hwnd);
+ if (!IsChild(hParent, GetFocus()))
+ SetFocus( hwnd );
+ }
+ else
+ SetFocus( hwnd );
+ }
}
}

--
1.9.1

1 change: 1 addition & 0 deletions patches/user32-dialog_focus/definition
@@ -0,0 +1 @@
Fixes: [46215] File Open Dialog fails to set focus to Filename text box

0 comments on commit 0121326

Please sign in to comment.