Beispiel #1
0
/*----------------------------------------------------------------------*/
static void
ShellPopdown(Widget w)
{
	XfeComboBoxPart *	cp  = _XfeComboBoxPart(w);

	assert( _XfeIsAlive(cp->shell) );

	_XmPopdown(cp->shell);
}
Beispiel #2
0
/*ARGSUSED*/
static void 
Popdown(Widget shell,
        XEvent *event,		/* unused */
	String *params,
	Cardinal *num_params)
{
  XmScreen screen = (XmScreen) XmGetXmScreen(XtScreen(shell));
  XmGrabShellWidget grabshell = (XmGrabShellWidget)shell;
  Time time;
  
  /* Record for replay detection */
  if (event && (event->type == ButtonPress || event->type == ButtonRelease)) {
    grabshell->grab_shell.unpost_time = event->xbutton.time;
  }

  if (!(time = XtLastTimestampProcessed(XtDisplay(shell))))
    time = CurrentTime;

  /* CR 9920:  Popdown may be called before MapNotify. */
  if (grabshell->shell.popped_up && grabshell->grab_shell.mapped)
    {
      XErrorHandler old_handler;

      if (screen -> screen.unpostBehavior == XmUNPOST_AND_REPLAY)
	GSAllowEvents(shell, ReplayPointer, event ? event->xbutton.time : time);
      XtUngrabPointer(shell, time);
      XtUngrabKeyboard(shell, time);
      _XmPopdown(shell);

      /* Reset focus to old holder */
      old_handler = XSetErrorHandler(IgnoreXErrors);
      if (time != CurrentTime) time = time - 1; /* Avoid race in wm */
      XSetInputFocus(XtDisplay(shell), grabshell->grab_shell.old_focus,
		     grabshell->grab_shell.old_revert_to, time);
      XSync(XtDisplay(shell), False);
      XSetErrorHandler(old_handler);
    }

  grabshell->grab_shell.mapped = False;
}