Here’s a cool gadget—a ‘knee defender’, available from here: http://www.kneedefender.com/
You attach it to the arms of your fold-out tray table on an aircraft and it prevents the person in front of you reclining their seat, thus protecting your knees and your laptop’s screen/lid from suddenly shutting! Seems these devices are legal…
Thanks to Joe for showing me one of these and explaining its use.