if (gtk_grab_get_current () != nsnull) {
GtkWidget *current_grab = gtk_grab_get_current();
handle_gdk_event (GdkEvent *event, gpointer data){  GtkObject *object = nsnull;  if (event->any.window)    gdk_window_get_user_data (event->any.window, (void **)&object);  if (object != nsnull &&      GDK_IS_SUPERWIN (object))    {      // It was an event on one of our superwindows      nsWindow *window = (nsWindow *)gtk_object_get_data (object, "nsWindow");            if (gtk_grab_get_current () != nsnull)        {          // A GTK+ grab is in effect. Rewrite the event to point to          // our toplevel, and pass it through.          // XXX: We should actually translate the coordinates          gdk_window_unref (event->any.window);          event->any.window = GTK_WIDGET (window->GetMozArea())->window;          gdk_window_ref (event->any.window);        }      else        {          // Handle it ourselves.          switch (event->type)            {            case GDK_KEY_PRESS:              handle_key_press_event (NULL, &event->key, window);              break;            case GDK_KEY_RELEASE:              handle_key_release_event (NULL, &event->key, window);              break;            default:              window->HandleEvent (event);            }          return;        }    }  gtk_main_do_event (event);}