[MPlayer-dev-eng] [PATCH] GUI cursor control

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Sep 11 11:31:29 CEST 2011


On Sat, Sep 10, 2011 at 02:05:02PM +0200, Ingo Brückl wrote:
>  
> +void vo_x11_handle_autohide_cursor(Display * dpy, Window win, int show)
> +{
> +  static unsigned int mouse_timer;
> +  static int mouse_waiting_hide;
> +
> +  if (show) {
> +      vo_showcursor(dpy, win);
> +      mouse_waiting_hide = 1;
> +      mouse_timer = GetTimerMS();
> +  } else if (mouse_waiting_hide && (GetTimerMS() - mouse_timer >= 1000)) {
> +      vo_hidecursor(dpy, win);
> +      mouse_waiting_hide = 0;
> +  }
> +}

Could you please add a bit of doxygen documentation?
Because the function signature might actually look like it would
work properly for multiple windows, but due to the mouse_timer/
mouse_waiting_hide variables being shared it will actually break
quite badly if someone ever tried to use it on multiple windows
at the same time.


More information about the MPlayer-dev-eng mailing list