Closed Bug 506754 Opened 15 years ago Closed 15 years ago

Widget focus code requires WM_ACTIVATE for WM_*FOCUS messages to work properly

Categories

(Core :: Widget: Win32, defect)

x86
Windows NT
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: robarnold, Assigned: enndeakin)

References

Details

Attachments

(1 file)

When a browser window is minimized, a call to ShowWindow(hWnd, SW_RESTORE) should properly restore focus. What seems to happen is that there's an extra WM_SETFOCUS/WM_KILLFOCUS message pair that moves focus from the child window (which had focus before the minimize) to the top level window. Because there is no WM_ACTIVATE that precedes this pair of messages, the event is suppressed so the focus manager does not restore focus to the child window. This occurs when restoring a minimized window programatically via the Windows 7 taskbar preview. An external application could attempt to do the same and we'd see the same result. Switching to another window and back again fixes the issue.
Attached patch patch (deleted) — Splinter Review
Seems that ShowWindow(mWnd, SW_RESTORE) isn't quite the same as the user restoring. The latter sends an extra WM_SETFOCUS. Instead, this patch fires an extra NS_ACTIVATE after restoring or maximizing. The focus manager will call SetFocus or the right child widget but do nothing more as the window is already active. The test changes don't actually test this bug, but are just an extra check to ensure everything is still focused as it should in case something else breaks.
Assignee: nobody → enndeakin
Status: NEW → ASSIGNED
Attachment #391086 - Flags: review?(emaijala)
Attachment #391086 - Flags: review?(emaijala) → review+
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: