Bug 618248, don't close popups when a window is lowered while dragging, prevents bookmark menu from closing, r=karl,a=blocking

This commit is contained in:
Neil Deakin 2010-12-31 14:20:00 -05:00
Родитель 574cbda199
Коммит d40e3ea557
1 изменённых файлов: 18 добавлений и 1 удалений

Просмотреть файл

@ -2891,7 +2891,24 @@ nsWindow::OnContainerFocusOutEvent(GtkWidget *aWidget, GdkEventFocus *aEvent)
LOGFOCUS(("OnContainerFocusOutEvent [%p]\n", (void *)this));
if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) {
check_for_rollup(aEvent->window, 0, 0, PR_FALSE, PR_TRUE);
nsCOMPtr<nsIDragService> dragService = do_GetService(kCDragServiceCID);
nsCOMPtr<nsIDragSession> dragSession;
dragService->GetCurrentSession(getter_AddRefs(dragSession));
// Rollup popups when a window is focused out unless a drag is occurring.
// This check is because drags grab the keyboard and cause a focus out on
// versions of GTK before 2.18.
PRBool shouldRollup = !dragSession;
if (!shouldRollup) {
// we also roll up when a drag is from a different application
nsCOMPtr<nsIDOMNode> sourceNode;
dragSession->GetSourceNode(getter_AddRefs(sourceNode));
shouldRollup = (sourceNode == nsnull);
}
if (shouldRollup) {
check_for_rollup(aEvent->window, 0, 0, PR_FALSE, PR_TRUE);
}
}
#ifdef MOZ_X11