[gtk2] OnContainerFocusOut may find wrong nswindow to dispatch deactive event

RESOLVED FIXED

Status

()

Core
XUL
RESOLVED FIXED
15 years ago
15 years ago

People

(Reporter: Robin Lu, Assigned: blizzard)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

15 years ago
In OnContainerFocusOut(), there are codes like:
1486     // Figure out if the focus widget is the child of this window.  If
1487     // it is, send a focus out and deactivate event for it.
1488     if (!gFocusWindow)
1489         return;
1490 
1491     GdkWindow *tmpWindow;
1492     tmpWindow = (GdkWindow *)gFocusWindow->GetNativeData(NS_NATIVE_WINDOW);
1493     nsWindow *tmpnsWindow = get_window_for_gdk_window(tmpWindow);
1494 
1495     while (tmpWindow && tmpnsWindow) {
1496         // found it!
1497         if (tmpnsWindow == gFocusWindow)
1498             goto foundit;
1499 
1500         tmpWindow = gdk_window_get_parent(tmpWindow);
1501         if (!tmpWindow)
1502             break;
1503 
1504         tmpnsWindow = get_owning_window_for_gdk_window(tmpWindow);
1505     }
In line 1497, tmpnsWindow is always equal to gFocusWindow at the first time
because tmpnsWindow is extracted from gFoucusWindow. Should it be "if
(tmpnsWindow == this)" instead ? This may deactive any current focused window.
(Reporter)

Comment 1

15 years ago
Created attachment 114993 [details] [diff] [review]
patch
(Assignee)

Comment 2

15 years ago
Comment on attachment 114993 [details] [diff] [review]
patch

r=blizzard

Woops.
Attachment #114993 - Flags: review+
(Reporter)

Comment 3

15 years ago
checked in.
Status: NEW → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.