Closed Bug 102099 Opened 23 years ago Closed 21 days ago

wParam can be NULL for WM_KILLFOCUS

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Windows 2000
defect

Tracking

()

RESOLVED INCOMPLETE
mozilla1.1alpha

People

(Reporter: kazhik, Unassigned)

Details

http://lxr.mozilla.org/seamonkey/source/widget/src/windows/nsWindow.cpp#3380 case WM_KILLFOCUS: char className[19]; ::GetClassName((HWND)wParam, className, 19); if(strcmp(className, WindowClass())) isMozWindowTakingFocus = PR_FALSE; This wParam can be NULL. GetClassName() doesn't set className in such case. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/keybinpt_9sc3.asp The code should be: case WM_KILLFOCUS: char className[19];className[0]=NULL; if( wParam != NULL ) ::GetClassName((HWND)wParam, className, 19); if(strcmp(className, WindowClass())) isMozWindowTakingFocus = PR_FALSE;
Or you could set isMozWindowTakingFocus to false directly if wParam is NULL.
kazhik, your suggestion isn't quite right. The strcmp() should be inside the if as well. Taking into account what Neil suggests as well gives something like... case WM_KILLFOCUS: if (!wParam) isMozWindowTakingFocus = PR_FALSE; else { char className[19]; ::GetClassName((HWND)wParam, className, 19); if(strcmp(className, WindowClass())) isMozWindowTakingFocus = PR_FALSE; } But if wParam is a Mozilla window and wParam represents the window getting focus, don't you think that isMozWindowTakingFocus should be set to PR_TRUE?
Do you think that the error which first of all influences GetClassName() by that code is satisfactory because the error which first of all influences GetClassName() by that code stops appearing?
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.7
Moving bugs from 0.9.7 for triaging in 0.9.8
Target Milestone: mozilla0.9.7 → mozilla0.9.8
Target Milestone: mozilla0.9.8 → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.1
QA Contact: madhur → rakeshmishra
QA Contact: rakeshmishra → trix
.
Assignee: joki → saari
Status: ASSIGNED → NEW
QA Contact: trix → ian
Assignee: saari → nobody
QA Contact: ian → events
Component: Event Handling → User events and focus handling
Severity: normal → S3

The code changed a lot since the bug was filed. I couldn't find the exact code as comment 0 in the searchfox now. Closing as INCOMPLETE.
If you think there's still an issue in the current m-c code, please file a new bug.

Status: NEW → RESOLVED
Closed: 21 days ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.