From 3e33d98fd6f8bab52d768a359de599953035c236 Mon Sep 17 00:00:00 2001 From: skeezix Date: Thu, 17 May 2012 21:56:15 -0400 Subject: [PATCH] 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.) --- minimenu/mmui.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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(); -- 2.39.2