If someone puts their hand on the top of your automatic and you pull the trigger and it clicks and does not fire do you have to rerack the gun to get the trigger reset to fire again?
To answer the OP’s question, if someone puts their hand(s) on your slide, and doesn’t put it out of battery, it’ll still fire if there’s a round in the chamber assuming your pistol is in working order or you have an ammo problem. However if it does fire, you’re generally only going to get that one shot since body parts, clothing, or less than ideal grip will cause a malfunction for the second shot.
If the slide is moved and goes out of battery, the hammer may or may not fall. If it doesn’t fall it’ll feel like a squishy trigger, but in either case the out of battery situation wouldn’t allow the firing pin/striker to hit the primer. I would argue that if it does, your gun isn’t in proper working order because that means your gun is capable of firing while out of battery.
What happens next depends on your specific weapon and how ‘out of battery’ your slide moved. Once your slide goes back into battery you might just be able to pull the trigger again for it to fire. It’s also just as likely that your pistol might be malfunctioned (i.e. FTE, Double feed, etc…) so you’ll have to perform an immediate action drill to clear the malfunction to fire again.
The arguments regarding why you let someone get to your weapon in the first place or the fact that pressing the weapon into a real body won’t cause an out of battery situation are false. I’ve done ground defense training as an instructor for years with SIM pistols and you can very easily put a gun out of battery as the BG and also just as easily put your own gun out of battery by pushing too hard into a body.
When in a fight it’s amazing the strength both sides can demonstrate when the parasympathetic kicks in. I've actually pushed a gun so hard into someone before that I racked the original round out and chambered a new round.
Semi or revolver, they both have their pros/cons. There is no perfect gun. Some derringer type pistols come close if it’s closed breach with no hammer, but they have their downsides too. It’s most important to know the pros/cons of your gun so you know what those strengths/weaknesses are. It’s also just as important to not get sucked into a false sense of security that somehow you’re more powerful just because you carry a gun. Lots of people, including LEOs, get shot with their own weapons.
With all due respect to the suggestion to put the weapon into your own body…please don’t. If you want to see what happens put your weapon into your mattress, heavy bag, or some other semi-soft surface. Experimenting on yourself shouldn’t be an option.