Fix bug with menus that went away when they shouldn't by not calling SetFocus (which the comment said we shouldn't do anyway) and sending an NS_LOSTFOCUS event instead of NS_DEACTIVATE when losing focus, as the GTK port does. r=blizzard@mozilla.org b=64791 (xlib changes only)

This commit is contained in:
dbaron%fas.harvard.edu 2001-03-10 03:45:16 +00:00
Родитель 1ce8056f20
Коммит 031ab8569f
1 изменённых файлов: 3 добавлений и 23 удалений

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

@ -241,12 +241,9 @@ static void CallProcessTimeoutsProc(Display *aDisplay)
FocusChangeMask | PropertyChangeMask | \ FocusChangeMask | PropertyChangeMask | \
ColormapChangeMask | OwnerGrabButtonMask ) ColormapChangeMask | OwnerGrabButtonMask )
NS_IMPL_ADDREF(nsAppShell)
NS_IMPL_RELEASE(nsAppShell)
nsAppShell::nsAppShell() nsAppShell::nsAppShell()
{ {
NS_INIT_REFCNT(); NS_INIT_ISUPPORTS();
mDispatchListener = 0; mDispatchListener = 0;
mScreen = nsnull; mScreen = nsnull;
@ -254,19 +251,7 @@ nsAppShell::nsAppShell()
xlib_fd = -1; xlib_fd = -1;
} }
nsresult nsAppShell::QueryInterface(const nsIID& aIID, void** aInstancePtr) NS_IMPL_ISUPPORTS1(nsAppShell, nsIAppShell)
{
nsresult result = NS_NOINTERFACE;
static NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID);
if (result == NS_NOINTERFACE && aIID.Equals(kIAppShellIID)) {
*aInstancePtr = (void*) ((nsIAppShell*)this);
NS_ADDREF_THIS();
result = NS_OK;
}
return result;
}
NS_METHOD nsAppShell::Create(int* argc, char ** argv) NS_METHOD nsAppShell::Create(int* argc, char ** argv)
{ {
@ -1095,11 +1080,6 @@ nsAppShell::HandleFocusInEvent(XEvent *event, nsWidget *aWidget)
focusEvent.point.y = 0; focusEvent.point.y = 0;
NS_ADDREF(aWidget); NS_ADDREF(aWidget);
// FIXME FIXME FIXME
// We now have to tell the widget that is has focus here, this was
// Previously done in cross platform code.
// FIXME FIXME FIXME
aWidget->SetFocus();
aWidget->DispatchWindowEvent(focusEvent); aWidget->DispatchWindowEvent(focusEvent);
NS_RELEASE(aWidget); NS_RELEASE(aWidget);
} }
@ -1111,7 +1091,7 @@ nsAppShell::HandleFocusOutEvent(XEvent *event, nsWidget *aWidget)
event->xfocus.window)); event->xfocus.window));
nsGUIEvent focusEvent; nsGUIEvent focusEvent;
focusEvent.message = NS_DEACTIVATE; focusEvent.message = NS_LOSTFOCUS;
focusEvent.widget = aWidget; focusEvent.widget = aWidget;
focusEvent.eventStructType = NS_GUI_EVENT; focusEvent.eventStructType = NS_GUI_EVENT;