Closed Bug 317486 Opened 19 years ago Closed 19 years ago

Some plug-ins may eat WM_SETFOCUS / WM_KILLFOCUS

Categories

(Core Graveyard :: Plug-ins, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: emk, Assigned: emk)

References

Details

Attachments

(2 files, 3 obsolete files)

Steps to reproduce: 1. Load the testcase. 2. Click on the Flash textbox. 3. Alt+Tab to switch other application. 4. Alt+tab again to return Mozilla. Actual result: Blur event won't be fired after step 3. You can't type text after step 4. Expected result: Blur event should be fired. You will have to press tab to type in textbox, but it's out of scope for this bug.
Attached file Testcase (deleted) —
Attached patch Patch rv1.0 (obsolete) (deleted) — Splinter Review
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Attachment #203996 - Flags: superreview?(roc)
Attachment #203996 - Flags: review?(roc)
Comment on attachment 203996 [details] [diff] [review] Patch rv1.0 Let's check what Ere has to say about this...
Attachment #203996 - Flags: superreview?(roc)
Attachment #203996 - Flags: superreview+
Attachment #203996 - Flags: review?(roc)
Attachment #203996 - Flags: review?(emaijala)
Comment on attachment 203996 [details] [diff] [review] Patch rv1.0 I think this is worth a shot, but I believe getting mPrevWinProc is in wrong place. You should move it to SubclassAndAssociateWindow. There you can do it unconditionally before the call to SubclassWindow and it'd be a simple assignment of currentWndProc.
Attachment #203996 - Flags: review?(emaijala) → review-
> I think this is worth a shot, but I believe getting mPrevWinProc is in wrong > place. You should move it to SubclassAndAssociateWindow. There you can do it > unconditionally before the call to SubclassWindow and it'd be a simple > assignment of currentWndProc. No, it's too late to get mPrevWinProc in SubclassAndAssociateWindow. Some plug-ins may already subclass our window in NPP_SetWindow which is called from CallSetWindow (And actually Flash Player did). Thus we are required to get mPrevWinProc BEFORE CallSetWindow.
Attached patch Adding comment to clarify:-) (obsolete) (deleted) — Splinter Review
Attachment #203996 - Attachment is obsolete: true
Attachment #204918 - Flags: review?(emaijala)
Comment on attachment 204918 [details] [diff] [review] Adding comment to clarify:-) Ok, but there's still one problem. You're assigning mPrevWinProc regardless of aPluginInstance (!= NULL) and only once. This will break at least if the first call is CallSetWindow(NULL), and it will cause a possibility for deadlock when unsubclassing (mPrevWinProc will point to the current WinProc). So what I think you should do is null it out whe unsubclassing. Then call it conditionally when the window messages are received. Ok? Then you should get rid of the assertion. Just get the current WndProc, compare to PluginWndProc and assign to mPrevWndProc if different. This would make the code more bulletproof.
Attachment #204918 - Flags: review?(emaijala) → review-
Attached patch Patch rv 1.2 (obsolete) (deleted) — Splinter Review
Resolving review comment.
Attachment #204918 - Attachment is obsolete: true
Attachment #204938 - Flags: review?(emaijala)
Comment on attachment 204938 [details] [diff] [review] Patch rv 1.2 + // Make sure activate/deactivate + // even if focus messages are eaten by plug-in Make it something like this: // Make sure setfocus and killfocus get through // even if they are eaten by the plugin + WNDPROC prevWndProc = (WNDPROC)win->GetPrevWindowProc(); No need for the cast (WNDPROC) here, right? r=emaijala with these fixed.
Attachment #204938 - Flags: review?(emaijala) → review+
Attached patch Patch rv 1.3 (deleted) — Splinter Review
Also limited prevWndProc scope.
Attachment #204938 - Attachment is obsolete: true
Attachment #204978 - Flags: superreview?(roc)
Attachment #204978 - Flags: review+
Attachment #204978 - Flags: superreview?(roc) → superreview+
checked-in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9alpha
Depends on: 328675
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: