Open Bug 127761 Opened 24 years ago Updated 3 years ago

Potential Focus problem when switching application

Categories

(Core :: XUL, defect)

x86
Windows 2000
defect

Tracking

()

People

(Reporter: bugzilla, Unassigned)

Details

In nsWindow.cpp, while processing a WM_KILLFOCUS, we set isMozWindowTakingFocus to false if the new window that get the focus is own by Mozilla. The problem is that since we support drop shadow windows (see bug 118368), we have 2 classes of windows in Mozilla but we test only for one of them. That sound wrong to me and could probably be the cause of some wierd focus problem.
proposed fix: case WM_KILLFOCUS: - char className[19]; - ::GetClassName((HWND)wParam, className, 19); - if(strcmp(className, WindowClass())) + char className[29]; + ::GetClassName((HWND)wParam, className, 29); + if(strcmp(className, WindowClass()) && strcmp(className, WindowPopupClass())) isMozWindowTakingFocus = PR_FALSE; if(gJustGotDeactivate) {
Yeah, we need to add any types that we may have added to this check.
Use sizeof className, not the repeated hardwired 29. Giving this to bryner, bounce to trudelle if I did wrong. I seriously doubt hyatt should get this. /be
Assignee: hyatt → bryner
+ if(strcmp(className, WindowClass()) && strcmp(className, WindowPopupClass())) Shouldn't that be || instead of &&?
Right, should be OR (||) and not AND (&&)
No, I was wrong. It should be &&. Expanded version of what you'd originally written: if (strcmp(className, WindowClass()) <> 0 && strcmp(className, WindowPopupClass()) <> 0) isMozWindowTakingFocus = PR_FALSE; Sorry, strcmps mess me up sometime. Using || would always evaluate to true.
Assignee: bryner → jag
QA Contact: jrgmorrison → xptoolkit.widgets
Assignee: jag → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.