use setWindowGroup to put popups in the tooltip layer on osx and make it so they don't get activate events r=sdagley/sr=sfraser. bug# 108804

This commit is contained in:
pinkerton%netscape.com 2002-01-15 23:06:20 +00:00
Родитель 2e1e0be117
Коммит e0ea61b217
1 изменённых файлов: 9 добавлений и 7 удалений

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

@ -478,13 +478,15 @@ nsresult nsMacWindow::StandardCreate(nsIWidget *aParent,
if ( mWindowMadeHere ) {
#if TARGET_CARBON
if ( mWindowType == eWindowType_popup ) {
// OSX enforces window layering so we have to make sure that popups can
// appear over modal dialogs (at the top of the layering chain). Create
// the popup like normal and change its window class to the modal layer.
//
// XXX This needs to use ::SetWindowGroup() when we move to headers that
// XXX support it.
::SetWindowClass(mWindowPtr, kModalWindowClass);
// Here, we put popups in the same layer as native tooltips so that they float above every
// type of window including modal dialogs. We also ensure that popups do not receive activate
// events and do not steal focus from other windows. Note that SetWindowGroup()
// does not exist on OS9 (even in CarbonLib) so we must check for it. It's ok not to
// do this on OS9 since it doesn't enforce the window layering that OSX does.
if ( (UInt32)SetWindowGroup != (UInt32)kUnresolvedCFragSymbolAddress ) {
::SetWindowGroup(mWindowPtr, ::GetWindowGroupOfClass(kHelpWindowClass));
::SetWindowActivationScope(mWindowPtr, kWindowActivationScopeNone);
}
}
else if ( mWindowType == eWindowType_dialog ) {
// Dialogs on mac don't have a close box, but we probably used a defproc above that