Exemple #1
0
/*****************************************************************************
 *
 * Waits Scr.ClickTime, or until it is evident that the user is not
 * clicking, but is moving the cursor
 *
 ****************************************************************************/
Bool IsClick(int x, int y, unsigned EndMask, XEvent * d)
{
    int xcurrent, ycurrent, total = 0;
    Time t0;
    extern Time lastTimestamp;

    xcurrent = x;
    ycurrent = y;
    t0 = lastTimestamp;

    while ((total < Scr.ClickTime) &&
            (x - xcurrent < 3) && (x - xcurrent > -3) &&
            (y - ycurrent < 3) && (y - ycurrent > -3) &&
            ((lastTimestamp - t0) < Scr.ClickTime)) {
        sleep_a_little(20000);
        total += 20;
        if (XCheckMaskEvent(dpy, EndMask, d)) {
            StashEventTime(d);
            return True;
        }
        if (XCheckMaskEvent(dpy, ButtonMotionMask | PointerMotionMask, d)) {
            xcurrent = d->xmotion.x_root;
            ycurrent = d->xmotion.y_root;
            StashEventTime(d);
        }
    }
    return False;
}
Exemple #2
0
	void X11Window::unmap_window()
	{
		// Clear exisitng StructureNofify events.
		XEvent event;
		while(XCheckMaskEvent(handle.display, StructureNotifyMask, &event));

		if (!is_window_mapped)
		{
			log_event("debug", "clan::X11Window::unmap_window(): Window already unmapped.");
			return;
		}

		log_event("debug", "clan::X11Window::map_window(): Unmapping window...");

		int result = XUnmapWindow(handle.display, handle.window);
		if ( (result == BadValue) || (result == BadWindow) )
			throw Exception("Failed to unmap window.");

		XFlush(handle.display);

		do {
			XWindowEvent(handle.display, handle.window, StructureNotifyMask, &event);
		} while (event.type != UnmapNotify);
		XFlush(handle.display);

		is_window_mapped = false;
	}
Exemple #3
0
void Delay (int DTime)
{
   fd_set f;
   struct timeval timeout;
   int cn;
   XEvent xe;

   if (key>=0) return;
   if (XCheckMaskEvent(dpy,KeyPressMask,&xe)) {
      process_event(&xe);
      if (key>=0) return;
   }

   if (drawcounter>0) {
      XClearWindow(dpy,w);
      XFlush(dpy);
      drawcounter=0;
   }

   timeout.tv_sec=DTime/1000;
   timeout.tv_usec=1000*(DTime%1000);
   FD_ZERO(&f);
   cn=ConnectionNumber(dpy);
   FD_SET(cn, &f);
   select(cn+1, &f, 0, 0, &timeout);
   
   /* note: the above implements a delay that is interrupted as
      soon as an X event occurs, a keypress/release in all practical
      cases. Interrupting the waiting upon keypress/release gives
      much smoother behaviour with puff.
   */
}
Exemple #4
0
void _pan_zoom(int mode) {
	int x, y, xx, yy, dx, dy, ig;
	unsigned int w, h, uig;
	Window wig;
	XEvent ev;
	XQueryPointer(dpy, root, &wig, &wig, &xx, &yy, &ig, &ig , &uig);
	XGetGeometry(dpy, presWin, &wig, &x, &y, &w, &h, &uig, &uig);
	XGrabPointer(dpy, root, true, PointerMotionMask | ButtonReleaseMask,
			GrabModeAsync, GrabModeAsync, None, None, CurrentTime);
	while (true) {
		XMaskEvent(dpy, PointerMotionMask | ButtonReleaseMask, &ev);
		if (ev.type == ButtonRelease) break;
		dx = ev.xbutton.x_root - xx; xx = ev.xbutton.x_root;
		dy = ev.xbutton.y_root - yy; yy = ev.xbutton.y_root;
		XClearWindow(dpy, topWin);
		if (mode == 1) {
			XMoveWindow(dpy, presWin, x+=dx, y+=dy);
		}
		else if (mode == 3) {
			if ((w+=dx) > winMax) w = winMax;
			if (w < winMin) w = winMin;
			if ((h+=dy) > winMax) h = winMax;
			if (h < winMin) h = winMin;
			XResizeWindow(dpy, presWin, w, h);
			render_page(cur, presWin, true);
		}
		while (XCheckMaskEvent(dpy, PointerMotionMask, &ev));
	}
	XUngrabPointer(dpy, CurrentTime);
}
bool 
XInterface::ProcessEvents()
{
	XEvent event;
	
	while(XPending(_display))
	{
		if(XCheckMaskEvent(_display, SubstructureNotifyMask, &event))
		{
			if(event.type == CreateNotify)
			{
			SelectEvents(event.xcreatewindow.window);
			}
		}
		else
		{
			XNextEvent(_display, &event);
		}
	}
	if( (event.type == KeyPress || event.type == ButtonPress || 
	 event.type == ButtonRelease || event.type == MotionNotify) 
	&& !event.xany.send_event )
	{
		time(&_last_event);
		return true;
	}
	return false;
}
Exemple #6
0
/* test for keyboard input character */
void ifkey(xxfmt *xx)
   {
   int msk;
   int XCheckMaskEvent();
   XEvent e;

   msk = KeyPressMask|ExposureMask;

   XSelectInput(xx->dpy, xx->w, msk);

   xx->runflg = 1;

   while (XCheckMaskEvent(xx->dpy, msk, &e))
      {
      if (e.type == KeyPress)
         {
	 exit(0);
         } /* if keypress event */
      else if (e.type == Expose)
         {
	 XClearWindow(xx->dpy,xx->w);
	 return;
         } /* if expose event */
      } /* if event received */
   } /* ifkey */
Exemple #7
0
void _glfwPlatformPollEvents(void)
{
    XEvent event;
    _GLFWwindow* window;

    while (XCheckMaskEvent(_glfwLibrary.X11.display, ~0, &event) ||
	   XCheckTypedEvent(_glfwLibrary.X11.display, ClientMessage, &event))
    {
	processEvent(&event);
    }

    // Check whether the cursor has moved inside an active window that has
    // captured the cursor (because then it needs to be re-centered)

    window = _glfwLibrary.activeWindow;
    if (window)
    {
	if (window->cursorMode == GLFW_CURSOR_CAPTURED &&
	    !window->X11.cursorCentered)
	{
	    _glfwPlatformSetCursorPos(window,
				      window->width / 2,
				      window->height / 2);
	    window->X11.cursorCentered = GL_TRUE;

	    // NOTE: This is a temporary fix.  It works as long as you use
	    //	     offsets accumulated over the course of a frame, instead of
	    //	     performing the necessary actions per callback call.
	    XFlush( _glfwLibrary.X11.display );
	}
    }
}
Exemple #8
0
void
Refresh(void)
{

    XEvent report;
    unsigned long mask_event;
    int count = 0;

/*
 * Check for X events that require redrawing the screen...
 */
    while (1) {
	mask_event =
	    ButtonPressMask | StructureNotifyMask | ExposureMask;
	while (XCheckMaskEvent(G_xStruct->display,
			       mask_event,
			       &report) == True) {
	    /* put it back first before checking for ButtonPress */
	    XPutBackEvent(G_xStruct->display, &report);
	    if (cur_img.error_condition == FALSE) {
		if (XCheckTypedWindowEvent(G_xStruct->display,
		       xcur_img.image_window, ButtonPress, &report) == True)
		    return;
	    } else {
		if (XCheckTypedWindowEvent(G_xStruct->display,
				G_big_window, ButtonPress, &report) == True)
		    return;
	    }
	    RefreshImageData(&cur_img, &xcur_img);
	}
	(void) sleep(1);
    }

}
Exemple #9
0
void ifkey(xxfmt *xx)
   {
   int msk;
   int symbol;
   int XCheckMaskEvent();
   XEvent e;
   XKeyEvent *k;

   msk = KeyPressMask|ExposureMask;

   XSelectInput(xx->dpy, xx->w, msk);

   while (XCheckMaskEvent(xx->dpy, msk, &e))
      {
      if (e.type == KeyPress)
         {
         k = (XKeyEvent *) &e;
         symbol = XLookupKeysym(k,0);
         if (symbol == XK_Escape
	    || symbol == XK_q)
            {
            xx->runflg = 0;
            } /* if quit */
         } /* if keypress event */
      else if (e.type == Expose)
         {
	 XClearWindow(xx->dpy,xx->w);
         } /* if expose event */
      } /* if event received */
   } /* ifkey */
Exemple #10
0
void skip_focusenter()
{
	XEvent ev;
	XEvent tmp;
	
	tmp.type=None;
	
	if(wglobal.current_wswindow==NULL ||
	   !on_active_workspace((WThing*)wglobal.current_wswindow))
		return;

	XSync(wglobal.dpy, False);
	
	while(XCheckMaskEvent(wglobal.dpy,
						  EnterWindowMask|FocusChangeMask, &ev)){
	#ifdef CF_WARP
		if(ev.type==EnterNotify && wglobal.focus_next==NULL){
			protect_previous();
			handle_enter_window(&ev);
			unprotect_previous();
			XFlush(wglobal.dpy);
		}else
	#endif
		
		/* Have to handle last focus in or else we may not get
		 * correct colormap.
		 */
		if(ev.type==FocusIn && wglobal.focus_next==NULL)
			memcpy(&tmp, &ev, sizeof(tmp));
	}
	
	if(tmp.type!=None)
		handle_focus_in(&(tmp.xfocus));
}
	void GLXPlatformContext::update()
	{
		XEvent xev;

		while(XCheckMaskEvent(mDisplay, StructureNotifyMask, &xev))
		{
			switch(xev.type)
			{
				case ConfigureNotify:

					if(xev.xconfigure.width != mWidth || xev.xconfigure.height != mHeight)
					{
						mWidth = xev.xconfigure.width;
						mHeight = xev.xconfigure.height;
						std::pair<size_t, size_t> report = std::make_pair(mWidth, mHeight);
						getSignal("WindowResized")->send(report);
					}

					break;

				case ClientMessage:

					if(xev.xclient.data.l[0] == mDeleteMessage)
					{
						getSignal("WindowClosed")->send(xev.xclient.data.l[0]);
					}

					break;
			}
		}
	}
Exemple #12
0
void tela_processa_eventos(tela_t *tela)
{
    /* processa eventos do servidor X, atualizando a posicao do mouse
     * e ultima tecla pressionada na variavel da tela-> */
    XEvent evento;
    XButtonEvent *be = (XButtonEvent *) & evento;
    XMotionEvent *me = (XMotionEvent *) & evento;
    XKeyEvent *ke = (XKeyEvent *) & evento;

    while (XCheckMaskEvent(tela->display, EVENT_MASK, &evento) == True) {
        switch (evento.type) {
        case ButtonPress:
            if (be->button == 1) tela->botao = true;
            break;
        case ButtonRelease:
            if (be->button == 1) tela->botao = false;
            break;
        case MotionNotify:
            tela->rato.x = XX2U(me->x);
            tela->rato.y = YX2U(me->y);
            break;
        case KeyPress:
            // se a tecla anterior nao foi lida, e' perdida
            tela->tecla = XKeycodeToKeysym(tela->display, ke->keycode, 0);
            break;
        case KeyRelease:
            break;
        }
    }
}
Exemple #13
0
void
maximize(int x, int y, int w, int h) {
	XEvent ev;

	if(!selmon->sel || selmon->sel->isfixed)
		return;
	XRaiseWindow(dpy, selmon->sel->win);
	if(!selmon->sel->ismax) {
		if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)
			selmon->sel->wasfloating = True;
		else {
			togglefloating(NULL);
			selmon->sel->wasfloating = False;
		}
		selmon->sel->oldx = selmon->sel->x;
		selmon->sel->oldy = selmon->sel->y;
		selmon->sel->oldw = selmon->sel->w;
		selmon->sel->oldh = selmon->sel->h;
		resize(selmon->sel, x, y, w, h, True);
		selmon->sel->ismax = True;
	}
	else {
		resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, True);
		if(!selmon->sel->wasfloating)
			togglefloating(NULL);
		selmon->sel->ismax = False;
	}
	drawbar(selmon);
	while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
}
Exemple #14
0
       bool WPintr()

/*     wp:s interrupt-rutin. Anropas med j�mna mellanrum
 *     av alla rutiner som kan ta l�ng tid p� sig. Sk�ter
 *     uppdatering av v�nta-meddelandet om v�nta �r p� samt
 *     pollar event-k�n efter <CTRL>c.
 *
 *     In: Inget.
 *
 *     Ut: Inget.
 *
 *     FV: TRUE  = V3 skall avbrytas.
 *         FALSE = Forts�tt exekveringen.
 *
 *     (C)microform ab 17/1/95 J. Kjellander
 *
 *     1998-02-26 event, J.Kjellander
 *
 *******************************************************!*/

 {
   XEvent          event;
   XKeyEvent      *keyev = (XKeyEvent *) &event;
   char            tknbuf[11];
   KeySym          keysym;
   XComposeStatus  costat;

/*
***Om n_larm > 0 �r v�nta-hanteringen p�slagen och det har
***g�tt tillr�ckligt med tid sen vi sist uppdaterade v�nta-
***meddelandet. Allts� uppdaterar vi igen. Om n_larm == 0
***har det antingen inte g�tt tillr�ckligt l�ng tid eller
***ocks� �r inte v�nta-hanteringen p�slagen �verhuvudtaget.
*/
   if ( n_larm > 0 )
     {
     drwait(TRUE);
   --n_larm;
/*
***Samtidigt som vi uppdaterar v�nta-meddelandet passar vi
***p� att polla eventk�n efter <CTRL>c.
*/
     while ( XCheckMaskEvent(xdisp,KeyPressMask,&event) )
       {
       if ( keyev->state & ControlMask  &&
            XLookupString(keyev,tknbuf,10,&keysym,&costat) == 1   &&
            tknbuf[0] == *smbind[11].str )
         {
         XBell(xdisp,100);
         XFlush(xdisp);
         return(TRUE);
         }
       }
     }

   return(FALSE);
 }
Exemple #15
0
void check4event()
{
  rstat=XCheckMaskEvent(dpy, ExposureMask | ButtonPressMask, &event);
  if (rstat&&(event.type == ButtonPress))
  {
    XFreeGC(dpy, context);
    XCloseDisplay(dpy);
    exit(0);
  }
}
Exemple #16
0
Bool
check_event_masked (register long mask, register XEvent * event_return)
{
	register int res;

	res = XCheckMaskEvent (dpy, mask, event_return);
	if (res)
		stash_event_time (event_return);
	return res;
}
Exemple #17
0
void handle_motion_event(XEvent* ev) {
    if (!g_drag_monitor) { return; }
    if (!g_win_drag_client) return;
    if (!g_drag_function) return;
    if (ev->type != MotionNotify) return;
    // get newest motion notification
    while (XCheckMaskEvent(g_display, ButtonMotionMask, ev));
    // call function that handles it
    g_drag_function(&(ev->xmotion));
}
Exemple #18
0
int crt0_keypressed(void)
{

  XEvent report;

  while(XCheckMaskEvent(display,ExposureMask|StructureNotifyMask,&report))
  { 
     switch(report.type)
     {
	case Expose:

           if (xw_expose !=NULL) (*xw_expose)(report.xexpose.x,report.xexpose.y,
	       report.xexpose.width,report.xexpose.height);
	   break;
	case ConfigureNotify:
	   bgi_maxx=report.xconfigure.width-1;
	   bgi_maxy=report.xconfigure.height-1;		
           if (xw_expose !=NULL) (*xw_expose)(0,0,bgi_maxx,bgi_maxy);
           sizeChanged=1;		
     }

  }


	
  if( XCheckMaskEvent(display,ButtonPressMask|ButtonReleaseMask|KeyPressMask|
  VisibilityChangeMask| ResizeRedirectMask|PropertyChangeMask|ColormapChangeMask,
	    &report))
  {	   
	switch(report.type)
	{
	case KeyPress:
	case ButtonPress:
	case ButtonRelease:
		XPutBackEvent(display,&report);
		return 1;
	default:
	 return 0;	
	}

  } return sizeChanged;
}
Exemple #19
0
/* force a statusline update, no matter how busy the application is.
   Use this with care (only for important messages).
*/
void
force_statusline_update(void)
{
#ifdef MOTIF
    XmUpdateDisplay(globals.widgets.top_level);
#else
    XEvent event;
    XSync(DISP, False);
    while (XCheckMaskEvent(DISP, ExposureMask, &event))
        XtDispatchEvent(&event);
#endif /* MOTIF */
}
Exemple #20
0
/* set flag when button pressed */
int EZX_TestCursor(Window w)
{
  
  
  XCheckMaskEvent(theDisplay, ButtonPressMask, &theEvent);
  
  if (w==(Window)NULL)   
    return (theEvent.xbutton.type == ButtonPress);
  else
    return ((theEvent.xbutton.type == ButtonPress) &&
	    (theEvent.xbutton.window==w));
}
Exemple #21
0
uint
flushevents(long event_mask, bool dispatch) {
	XEvent ev;
	uint n = 0;

	while(XCheckMaskEvent(display, event_mask, &ev)) {
		if(dispatch)
			dispatch_event(&ev);
		n++;
	}
	return n;
}
Exemple #22
0
bool GWindow::getNextEvent(XEvent& e) {
    long eventMask =  
        ExposureMask | ButtonPressMask | ButtonReleaseMask
        | KeyPressMask | PointerMotionMask
        | StructureNotifyMask       // For resize event
        | SubstructureNotifyMask
        | FocusChangeMask;
    return (
        XCheckMaskEvent(m_Display, eventMask, &e) != 0 ||
        XCheckTypedEvent(m_Display, ClientMessage, &e) != 0
    );
}
void APIENTRY glutMainLoop (void)
{
   GLboolean idle;
   GLboolean have_event;
   XEvent evt;
   int visible = 0;

   glutPostRedisplay();
   if (reshape_func) reshape_func(g_width, g_height);

   while (GL_TRUE) {
      idle = GL_TRUE;


      if (visible && idle_func) 
	 have_event = XCheckMaskEvent( dpy, ~0, &evt );
      else 
	 have_event = XNextEvent( dpy, &evt );

      if (have_event) {
	 idle = GL_FALSE;
	 switch(evt.type) {
	 case MapNotify:
	    if (visibility_func) {
	       visibility_func(GLUT_VISIBLE);
	    }
	    visible = 1;
	    break;
	 case UnmapNotify:
	    if (visibility_func) {
	       visibility_func(GLUT_NOT_VISIBLE);
	    }
	    visible = 0;
	    break;
	 case Expose:
	    g_redisplay = 1;
	    break;
	 }
      }

      if (visible && g_redisplay && display_func) {
	 idle        = GL_FALSE;
	 g_redisplay = GL_FALSE;

	 display_func();
      }

      if (visible && idle && idle_func) {
	 idle_func();
      }
   }
}
Exemple #24
0
Bool
apc_pointer_set_pos( Handle self, int x, int y)
{
	XEvent ev;
	if ( !XWarpPointer( DISP, None, guts. root,
		0, 0, guts. displaySize.x, guts. displaySize.y, x, guts. displaySize.y - y - 1))
		return false;
	XCHECKPOINT;
	XSync( DISP, false);
	while ( XCheckMaskEvent( DISP, PointerMotionMask|EnterWindowMask|LeaveWindowMask, &ev))
		prima_handle_event( &ev, nil);
	return true;
}
Exemple #25
0
Bool recursively_find_motion_notify (int depth)
{
	XEvent junk_event;

	if (XCheckMaskEvent (dpy, 0xFFFFFFFF, &junk_event)) {
		XPutBackEvent (dpy, &junk_event);
		if (junk_event.type == MotionNotify)
			return True;
		if (depth > 0)
			return recursively_find_motion_notify (depth - 1);
	}
	return False;
}
void
NestedClientCheckEvents(NestedClientPrivatePtr pPriv) {
    XEvent ev;

    while(XCheckMaskEvent(pPriv->display, ~0, &ev)) {
        switch (ev.type) {
        case Expose:
            NestedClientUpdateScreen(pPriv,
                                     ((XExposeEvent*)&ev)->x,
                                     ((XExposeEvent*)&ev)->y,
                                     ((XExposeEvent*)&ev)->x + 
                                     ((XExposeEvent*)&ev)->width,
                                     ((XExposeEvent*)&ev)->y + 
                                     ((XExposeEvent*)&ev)->height);
            break;

#ifdef NESTED_INPUT
        case MotionNotify:
            if (!pPriv->dev) {
                xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initialized, ignoring input.\n");
                break;
            }

            NestedInputPostMouseMotionEvent(pPriv->dev,
                                            ((XMotionEvent*)&ev)->x,
                                            ((XMotionEvent*)&ev)->y);
            break;

        case ButtonPress:
        case ButtonRelease:
            if (!pPriv->dev) {
                xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initialized, ignoring input.\n");
                break;
            }

            NestedInputPostButtonEvent(pPriv->dev, ev.xbutton.button, ev.type == ButtonPress);
            break;

        case KeyPress:
        case KeyRelease:
            if (!pPriv->dev) {
                xf86DrvMsg(pPriv->scrnIndex, X_INFO, "Input device is not yet initialized, ignoring input.\n");
                break;
            }

            NestedInputPostKeyboardEvent(pPriv->dev, ev.xkey.keycode, ev.type == KeyPress);
            break;
#endif
        }
    }
}
Exemple #27
0
/* force a statusline update, no matter how busy the application is.
   Use this with care (only for important messages).
*/
void
force_statusline_update(void)
{
#ifdef STATUSLINE
#ifdef MOTIF
    XmUpdateDisplay(top_level);
#else
    XEvent event;
    XSync(DISP, 0);
    while (XCheckMaskEvent(DISP, ExposureMask, &event))
        XtDispatchEvent(&event);
#endif
#endif    
}
Exemple #28
0
value caml_gr_sigio_handler(void)
{
  XEvent grevent;

  if (caml_gr_initialized && !caml_gr_ignore_sigio) {
    while (XCheckMaskEvent(caml_gr_display, -1 /*all events*/, &grevent)) {
      caml_gr_handle_event(&grevent);
    }
  }
#ifdef USE_ALARM
  alarm(1);
#endif
  return Val_unit;
}
Exemple #29
0
int ml_checkmaskevent(Display * d, long m, XEvent * * xe, int * typ) {

  XEvent * x = (XEvent*) malloc(sizeof (XEvent));
  
  if (XCheckMaskEvent(d, m, x)) {
    *typ = x->type;    
    *xe = x;
    return 1;
  } else {
    free (x);
    return 0;
  }

}
Exemple #30
0
gpointer x11_event_thread(gpointer data)
{
    GCContext    *context = (GCContext*)data;
    GCX11Context *x11     = &context->X11_context;
    Movie        *movie   =  context->movie_context;

    long event_mask = KeyReleaseMask;

    XSelectInput(x11->display, x11->root_window, event_mask);

    do {
        XEvent event;

        if (XCheckMaskEvent(x11->display, event_mask, &event)) {
            XKeyEvent *keyEvent = (XKeyEvent*)&event;
            g_message("Key pressed: %d", keyEvent->keycode);

            g_mutex_lock(&context->movie_context->tick_lock);

            /*if (keyEvent->keycode == KEYCODE_RIGHT) {
               movie->ease_to_frame = get_frame_offset(context, GO_TO_NEXT_DAY, DAY_OFFSET_NOW); 
               movie->ease_to = TRUE;
               g_cond_broadcast(&context->movie_context->tick_cond);
            } else */
            if (keyEvent->keycode == KEYCODE_LEFT || keyEvent->keycode == KEYCODE_ESC) {
               exit(1);
               //movie->ease_to_frame = get_frame_offset(context, GO_TO_RAND_DAY, DAY_OFFSET_NOW); 
               //movie->ease_to = TRUE;
               //g_cond_broadcast(&context->movie_context->tick_cond);
            } else if (keyEvent->keycode == KEYCODE_UP) {
               movie->ease_to_frame = get_frame_offset(context, GO_TO_NEXT_DAY, DAY_OFFSET_NOW); 
               movie->ease_to = TRUE;
               g_cond_broadcast(&context->movie_context->tick_cond);
            } else if (keyEvent->keycode == KEYCODE_DOWN) {
               movie->ease_to_frame = get_frame_offset(context, GO_TO_PREV_DAY, DAY_OFFSET_NOW); 
               movie->ease_to = TRUE;
               g_cond_broadcast(&context->movie_context->tick_cond);
            }

            g_mutex_unlock(&context->movie_context->tick_lock);
        }

        g_thread_yield();
        delay_usec(10000);

    } while (!context->exit);

    return NULL;
}