[MPlayer-dev-eng] [PATCH] GUI cursor control
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Wed Sep 7 18:11:43 CEST 2011
On Tue, Sep 06, 2011 at 06:43:01PM +0200, Ingo Brückl wrote:
> On the other hand, we could simply have a.patch to block WinIDs and a
> b.patch for the GUI to implement autohide.
For that one the GUI code seems broken, if mouse_time is 0 by pure
chance the mouse pointer seems to get stuck on.
> +void vo_x11_show_autohide_cursor(Display * mydisplay, int start)
"start" seems like a bad name, rather "show", "movement", "reset" or something
like that would fit better IMO.
And "show" is a bit confusing as well, maybe "handle" or such instead?
> + if (start) {
> + vo_showcursor(mydisplay, vo_window);
> + mouse_waiting_hide = 1;
> + mouse_timer = GetTimerMS();
> + }
> + else if (mouse_waiting_hide && (GetTimerMS() - mouse_timer >= 1000)) {
> + vo_hidecursor(mydisplay, vo_window);
> + mouse_waiting_hide = 0;
Since I think they are no more used anywhere else,
mouse_waiting_hide and mouse_timer variables should be moved into
this function.
> + vo_x11_show_autohide_cursor(mydisplay, VO_FALSE);
Just 0/1 is better than VO_TRUE/VO_FALSE, especially for code that will
be used from the GUI.
Otherwise that seems like a fine solution to me...
More information about the MPlayer-dev-eng
mailing list