You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
more fixes around DialogEx focus handling and default pushbuttons
I found some more areas inside existing walk code where it is trying
to re-implement various dialog manager features that we want to
avoid when using DialogEx:
* Form's WM_ACTIVATE handler tries to save and restore the currently
focused widget. This competes with the dialog manager, so I added
an override in DialogEx to only track the active form.
* I made WM_NEXTDLGCTL use SendMessage whenever possible by flagging
when we're handling focus messages and only switching to PostMessage
when we risk re-entering. We set that flag in WM_SETFOCUS and
WM_KILLFOCUS handlers.
* I prevent layout from forcibly focusing widgets when the enclosing
form is a DialogEx; we want that dealt with elsewhere.
* I created overrides for setCtrlID and clearCtrlID in PushButton that
also set/clear BS_DEFPUSHBUTTON and re-focus the default pushbutton.
This is necessary because setting focus to the default pushbutton
typically happens when a dialog template is processed at creation
time; of course, we're attaching widgets long after that has occurred.
We also want to clear BS_DEFPUSHBUTTON once detaching widgets from
the form, otherwise invalid state remains cached internally to Win32.
Updates tailscale/corp#23789
Signed-off-by: Aaron Klotz <[email protected]>
0 commit comments