It seems for some reason the recreation of menus is triggered approx. every 5 minutes. I know the monitoring is setup through xfdesktop, which in turn uses thunar-vfs, which in turn uses the fam API. All of these are probably pretty well tested pieces of software, but it can't be normal for a rescan of all .desktop files accessible every 5 minutes, unless I'm installing some new software or are changing these files somehow, right? This is happening even on an idling system. Both of my desktops run gamin.
Running xfdesktop in debugging mode showed me that it's $HOME/.local/share/applications/defaults.list which is causing the triggering. Searching in thunar's code reveals that it runs thunar-vfs-mime-cleaner every 5 minutes, which seems to change this file (or at least trigger the monitoring). Would changes to this file really be important for the menu? Maybe we can exclude it from triggering a menu rebuild for now? It'd be a hack, but that should work...
Created attachment 2186 xfdesktop's debug log output (one iteration of a regeneration) Jannis agreed that this could easily be fixed in xfdesktop. All paths changed which _start_ with $HOME.local/share/applications/defaults.list (substitute the appropriate $XDG variable in there) would need to be ignored. I personally would really like to see this in 4.6.0. You guys are probably faster at cooking up a patch, but if there's no time I'll gladly do the job.
Yeah... or, better, it should ignore file changes that don't end in .desktop or .menu... right?
Don't forget about .directory files. But yeah, either just ignore files called "defaults.list" or only react on change events from .menu, .desktop and .directory files.
Fixed checked in. David tested, seems to be ok.