Ejemplo n.º 1
0
void
considerLocStillEvent()
{ if ( !loc_still_posted )
  { unsigned long now = mclock();

    if ( now - host_last_time < (unsigned long)loc_still_time )
    { DEBUG(NAME_locStill, Cprintf("TimeDiff = %d (ignored)\n", now - host_last_time));
      return;
    }

    if ( !pceMTTryLock(LOCK_PCE) )
      return;
    if ( instanceOfObject(last_window, ClassWindow) &&
	 !onFlag(last_window, F_FREED|F_FREEING) &&
	 valInt(last_x) > 0 && valInt(last_y) > 0 )
    { ServiceMode(is_service_window(last_window),
		  { AnswerMark mark;
		    EventObj e;

		    markAnswerStack(mark);
		    e = newObject(ClassEvent,
				  NAME_locStill, last_window,
				  last_x, last_y, last_buttons,
				  toInt(last_time + now - host_last_time), EAV);
		    addCodeReference(e);
		    postNamedEvent(e, (Graphical) last_window, DEFAULT, NAME_postEvent);
		    delCodeReference(e);
		    freeableObj(e);
		    rewindAnswerStack(mark, NIL);
		  })
    }
Ejemplo n.º 2
0
static void
event_window(Widget w, XtPointer xsw, XtPointer xevent)
{ PceWindow sw = (PceWindow) xsw;
  XEvent *event = (XEvent *)xevent;

  pceMTLock(LOCK_PCE);
  DEBUG(NAME_event, Cprintf("event_window(): X-event %d on %s\n",
			    event->xany.type, pp(sw)));

  if ( isFreeingObj(sw) || isFreedObj(sw) || sw->sensitive == OFF )
  { pceMTUnlock(LOCK_PCE);
    return;
  }

  ServiceMode(is_service_window(sw),
	      { AnswerMark mark;
		markAnswerStack(mark);

		x_event_window(sw, event);

		rewindAnswerStack(mark, NIL);
	      });