Author: titmuss
Date: Fri Dec 19 13:06:50 2008
New Revision: 3580

URL: http://svn.slimdevices.com?rev=3580&root=Jive&view=rev
Log:
 r3...@harrypotter (orig r3579):  titmuss | 2008-12-19 21:05:09 +0000
 Bug: N/A
 Description:
 Hide mouse pointer on inactivity.
 
 

Modified:
    7.4/branches/pango/   (props changed)
    7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c

Propchange: 7.4/branches/pango/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Dec 19 13:06:50 2008
@@ -3,7 +3,7 @@
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.1/trunk:2920
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.2/trunk:2921
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.3/trunk:3550
-bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:3557
+bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/7.4/trunk:3579
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/7.0:2013
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/SN:1083
 bbe22326-0783-4b3a-ac2b-7ab96b24c8d9:/branches/scrolling:1378

Modified: 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c
URL: 
http://svn.slimdevices.com/7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c?rev=3580&root=Jive&r1=3579&r2=3580&view=diff
==============================================================================
--- 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c 
(original)
+++ 7.4/branches/pango/squeezeplay/src/squeezeplay/src/ui/jive_framework.c Fri 
Dec 19 13:06:50 2008
@@ -34,6 +34,8 @@
 
 /* button hold threshold 1 seconds */
 #define HOLD_TIMEOUT 1000
+
+#define POINTER_TIMEOUT 20000
 
 static bool update_screen = true;
 
@@ -66,6 +68,8 @@
 static SDL_TimerID key_timer = NULL;
 
 static SDL_TimerID mouse_timer = NULL;
+
+static SDL_TimerID pointer_timer = NULL;
 
 static Uint16 mouse_origin_x, mouse_origin_y;
 
@@ -174,7 +178,7 @@
        jive_surface_set_wm_icon(icon);
        jive_surface_free(icon);
 
-//     SDL_ShowCursor (SDL_DISABLE);
+       SDL_ShowCursor(SDL_DISABLE);
        SDL_EnableKeyRepeat (100, 100);
        SDL_EnableUNICODE(1);
 
@@ -840,6 +844,12 @@
        return 0;
 }
 
+static Uint32 pointer_callback(Uint32 interval, void *param) {
+       SDL_ShowCursor(SDL_DISABLE);
+
+       return 0;
+}
+
 
 static int do_dispatch_event(lua_State *L, JiveEvent *jevent) {
        int r;
@@ -942,6 +952,14 @@
                break;
 
        case SDL_MOUSEMOTION:
+
+               /* show mouse cursor */
+               if (pointer_timer) {
+                       SDL_RemoveTimer(pointer_timer);
+               }
+               SDL_ShowCursor(SDL_ENABLE);
+               SDL_AddTimer(POINTER_TIMEOUT, &pointer_callback, NULL);
+
                if (event->motion.state & SDL_BUTTON(1)) {
                        if ( ( (mouse_state == MOUSE_STATE_DOWN || mouse_state 
== MOUSE_STATE_SENT)
                               && (abs(mouse_origin_x - event->motion.x) > 10

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to