nsGUIEvent event;  event.message = NS_ACTIVATE; event.widget  = widget;  event.eventStructType = NS_GUI_EVENT;  event.time = 0; event.point.x = 0; event.point.y = 0;
nsGUIEvent eventGotFocus; eventGotFocus.message = NS_GOTFOCUS; printf("Send NS_GOTFOCUS from handle_toplevel_focus_in\n"); eventGotFocus.widget  = widget; eventGotFocus.eventStructType = NS_GUI_EVENT; eventGotFocus.time = 0; eventGotFocus.point.x = 0; eventGotFocus.point.y = 0;
gint handle_toplevel_focus_in(GtkWidget *      aWidget,                               GdkEventFocus *  aGdkFocusEvent,                               gpointer         aData){  if(!aWidget) {    return PR_TRUE;  }  if(!aGdkFocusEvent) {    return PR_TRUE;  }  nsWidget * widget = (nsWidget *) aData;  if(!widget) {    return PR_TRUE;  }  nsGUIEvent event;    event.message = NS_ACTIVATE;  event.widget  = widget;  event.eventStructType = NS_GUI_EVENT;  event.time = 0;  event.point.x = 0;  event.point.y = 0;   NS_ADDREF(widget);   nsEventStatus status;  widget->DispatchEvent(&event, status);    NS_RELEASE(widget);    return PR_TRUE;}