X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=minimenu%2Fmmenu.c;h=3cb5d18e7a4aa0be87f4b0388bfbf899df1416e4;hb=8ef3368ac2413598f8e3b6e1c9d38f317ad63779;hp=02fe2a1312cc34935f25baa9e983771f0c3a34c2;hpb=dfdfc979e18d84804e0fff5d87bc6c2c1a875e66;p=pandora-libraries.git diff --git a/minimenu/mmenu.c b/minimenu/mmenu.c index 02fe2a1..3cb5d18 100644 --- a/minimenu/mmenu.c +++ b/minimenu/mmenu.c @@ -373,16 +373,16 @@ int main ( int argc, char *argv[] ) { /* actual work now */ - unsigned char block = 1; - if ( g_autorescan ) { - block = 0; // set up notifications dbh = pnd_dbusnotify_init(); pnd_log ( pndn_debug, "Setting up dbusnotify\n" ); //setup_notifications(); + // create a timer thread, that will trigger us to check for SD insert notifications every once in awhile + ui_threaded_timer_create(); + } // set up rescan /* set speed to minimenu run-speed, now that we're all set up @@ -405,33 +405,8 @@ int main ( int argc, char *argv[] ) { // show the menu, or changes thereof ui_render(); - // wait for input or time-based events (like animations) - // deal with inputs - ui_process_input ( block /* block */ ); - - // did a rescan event trigger? - if ( g_autorescan ) { - unsigned char watch_dbus = 0; - unsigned char watch_inotify = 0; - - if ( dbh ) { - watch_dbus = pnd_dbusnotify_rediscover_p ( dbh ); - } - - if ( nh ) { - watch_inotify = pnd_notify_rediscover_p ( nh ); - } - - if ( watch_dbus || watch_inotify ) { - pnd_log ( pndn_debug, "dbusnotify detected SD event\n" ); - applications_free(); - applications_scan(); - } - - } // rescan? - - // sleep? block? - usleep ( 100000 /*5000*/ ); + // wait for input or time-based events (like animations) and deal with inputs + ui_process_input ( dbh, nh ); } // while