Search
lxdream.org :: lxdream/src/drivers/joy_linux.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/drivers/joy_linux.c
changeset 621:225d147d2b43
prev620:d9b28f78b952
next637:6a284eff5311
author nkeynes
date Fri Feb 08 00:59:15 2008 +0000 (16 years ago)
permissions -rw-r--r--
last change Fix premature deletion of the old device when changing devices
file annotate diff log raw
1.1 --- a/src/drivers/joy_linux.c Wed Jan 30 11:31:21 2008 +0000
1.2 +++ b/src/drivers/joy_linux.c Fri Feb 08 00:59:15 2008 +0000
1.3 @@ -240,23 +240,24 @@
1.4
1.5 /*************************** dnotify support **********************/
1.6
1.7 -static volatile gboolean need_input_rescan = FALSE;
1.8 +static volatile int need_input_rescan = 0;
1.9 static int watch_dir_fd;
1.10
1.11 static gboolean gtk_loop_check_input(gpointer data)
1.12 {
1.13 - if( need_input_rescan ) {
1.14 + if( need_input_rescan == 1 ) {
1.15 + need_input_rescan = 0;
1.16 int js = linux_joystick_scan();
1.17 if( js > 0 ) {
1.18 maple_reattach_all();
1.19 }
1.20 }
1.21 - return TRUE;
1.22 + return need_input_rescan != 2;
1.23 }
1.24
1.25 static void dnotify_handler(int sig )
1.26 {
1.27 - need_input_rescan = TRUE;
1.28 + need_input_rescan = 1;
1.29 }
1.30
1.31 static gboolean linux_joystick_install_watch( const gchar *dir )
1.32 @@ -280,4 +281,5 @@
1.33 {
1.34 signal( SIGRTMIN+1, SIG_IGN );
1.35 close( watch_dir_fd );
1.36 + need_input_rescan = 2;
1.37 }
.