Thinlinc loses keyboard after screensaver

You identified the correct issue I believe, here’s the ThinLinc bug for it:

https://www.cendio.com/bugzilla/show_bug.cgi?id=4776

Unfortunately, for now, the best thing we can recommend is to use a different screensaver on your Ubuntu client. This is a bug in the screensaver and there’s not much we can do to solve it at the moment.

If you want to you can add a script on your desktop (or any menu) that you can run by clicking it. This script will disconnect the ThinLinc session, it will not log you out:

#!/bin/sh
vncconfig -disconnect

Another option you have is to configure a MaxIdleTime, this will disconnect your session after a time of inactivity:

https://www.cendio.com/resources/docs/tag/config_lifetime.html?highlight=maxidle