When I have virtualbox in full screen, on Unity it always locks after 5 minutes, but in Gnome3 (and even Unity7) it shows a popup message: lock was blocked by an application.
Can I force Unity or Gnome3 to always lock regardless of FULL-SCREENED applications?
To enable screen lock when VirtualBox guest is in full screen, go to VirtualBox Manager -> File -> Preferences -> Input and switch off "Auto Capture Keyboard".
Click OK and run guest OS in full screen mode. Screen should auto lock now, and without annoying notification "lock was blocked by application". I'm using Ubuntu 20.04 LTS with VirtualBox 6.1.26.
PS: Is security issue fixed? - Yes, screen lock is working now. Whether usability is lowered? - Yes, a little. This is a kind of trade-off between security and usability. You choose.
It's a known bug that has other Gnome 3 distros, perhaps it has bitten Ubuntu too... https://bugzilla.redhat.com/show_bug.cgi?id=1369880
This is by design. If the virtual box has captured you mouse and keyboard; then your gnome locked your screen... you would not be able to log in again. This would fall more under virtualbox as they would need to release the cursor and keyboard given certain events.