The fuel pump once the kill switch has been turned on should prime for about a second. Are you saying it stays running even if you havent started the engine?
a few things to consider, bad Head temp sensor can cause improper fueling when cold or hot
Lagging or biased oxygen sensor, not likely considering your issue is at idle
Aftermarket exhaust? Has the ecm been tuned? These things in own or together can influence fueling during cruising, cause the global fueling or AFV (air fuel value) to be incorrect for starting, warm up or idle.
Leaking fuel injector rare and would have to be very bad, a few cycles of the ignition switch and a test crank can help you determine if this is likely, cause it would become very difficult to start.
Incorrect heat range of spark plugs, some bikes like one plug, others like something else. Theres a science behind it, but too many factors to even try to explain and figure out.
Maybe its not rich, lean can cause idle issues as well, intake seals have been a common issue on XBs common is relative to posts online, ive never actually seen an issue with these unless the bikes been molested.
ECMspy would be a great diagnostic tool for this. Unfortunately a lot issues cant be solved by a quick forum post and throwing a few parts at it. But you now have some things to research. Good luck.