signal_handler::handler_function_type
    signal_handler::handler(signed signo, handler_function_type new_handler)
    {
      TRACE("hugh::support::signal_handler::handler(set)");
    
      handler_function_type old_handler(handler_map[signo]);

      if (new_handler) {
        handler_map[signo] = new_handler;
      }
    
      return old_handler;
    }
Esempio n. 2
0
int KXErrorHandler::handle(Display *dpy, XErrorEvent *e)
{
    if(dpy == display
       // e->serial >= first_request , compare like X timestamps to handle wrapping
       && NET::timestampCompare(e->serial, first_request) >= 0)
    { // it's for us
        // qDebug( "Handling: %p", static_cast< void* >( this ));
        if(user_handler1 != NULL && user_handler1(e->request_code, e->error_code, e->resourceid))
            was_error = true;
        if(user_handler2 != NULL && user_handler2(dpy, e) != 0)
            was_error = true;
        else // no handler set, simply set that there was an error
            was_error = true;
        return 0;
    }
    // qDebug( "Going deeper: %p", static_cast< void* >( this ));
    return old_handler(dpy, e);
}