From 1bc071b87af0e9c40f892bc9bfffe243c6a6dc7c Mon Sep 17 00:00:00 2001 From: "smfr%smfr.org" Date: Wed, 16 Feb 2005 05:14:59 +0000 Subject: [PATCH] Fix bug 281732: event handling in camino's native popup got broken when screen-relative coordinates in Cocoa widget were fixed (bug 281470), which caused the nsComboboxControlFrame/nsListControlFrame code to start doing mouse capture, and showing the XUL popup. This revealed a bug in nsCocoaWindow, which failed to set the window type in some situations. This change only affects Camino. --- widget/src/cocoa/nsCocoaWindow.mm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/widget/src/cocoa/nsCocoaWindow.mm b/widget/src/cocoa/nsCocoaWindow.mm index 845954ea541d..80c4f1edc9a1 100644 --- a/widget/src/cocoa/nsCocoaWindow.mm +++ b/widget/src/cocoa/nsCocoaWindow.mm @@ -364,11 +364,13 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent, Inherited::BaseCreate ( aParent, aRect, aHandleEventFunction, aContext, aAppShell, aToolkit, aInitData ); - if ( !aNativeParent ) { + if (!aNativeParent || (aInitData && aInitData->mWindowType == eWindowType_popup)) + { mOffsetParent = aParent; nsWindowType windowType = eWindowType_toplevel; - if (aInitData) { + if (aInitData) + { mWindowType = aInitData->mWindowType; // if a toplevel window was requested without a titlebar, use a dialog windowproc if (aInitData->mWindowType == eWindowType_toplevel && @@ -377,7 +379,9 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent, windowType = eWindowType_dialog; } else + { mWindowType = (mIsDialog ? eWindowType_dialog : eWindowType_toplevel); + } // create the cocoa window NSRect rect;