I couldn't reproduce this. Could you check this again with the latest version.
Abdel has already pointed out that this is non-windows. I have identified this bug as http://bugzilla.lyx.org/show_bug.cgi?id=3622
Could you please also have a look at the new chapter 7 about listings, that everything is correct what I wrote?
I made a few changes. Insert->Caption should work and should be desribed as so. (A bug is another matter). Bo