From: skeezix Date: Fri, 18 May 2012 01:56:15 +0000 (-0400) Subject: mmenu: introduced artificial delay after SD event (ins/eject); mmenu is racing agains... X-Git-Tag: sz_beta5^0 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e33d98fd6f8bab52d768a359de599953035c236;p=pandora-libraries.git mmenu: introduced artificial delay after SD event (ins/eject); mmenu is racing against pndnotifyd and if mmenu wakes up first, then the lockfile is not yet present and mmenu sees minimal changes.. so if we make mmenu wait a second or two then almost certainly pndnotifyd should have awoken and set up its lockfile. (Another option is to tweak pndnotifyd to wake up more often, but I prefer not to bother that application as it is omnipresent .. lets avoid introducing cpu leach.) --- diff --git a/minimenu/mmui.c b/minimenu/mmui.c index 571fd01..50e3324 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -1484,7 +1484,16 @@ void ui_process_input ( pnd_dbusnotify_handle dbh, pnd_notify_handle nh ) { } if ( watch_dbus || watch_inotify ) { + pnd_log ( pndn_debug, "dbusnotify detected SD event\n" ); + + // sometimes mmenu notices the SD event before pndnotifyd does, since pndnotifyd + // is coded not to react too quickly (in the event of multiple spammed events or + // other weird stuff that was seen when it was being written.) As such, lets wait + // a second to give pndnotifyd a chance to have awoken.. + SDL_Delay ( 1500 ); // in 1/1000th of seconds + + // kick off a rescan applications_free(); applications_scan();