I have used Gnome for a long time and always have seen this problem. When I close the laptop lid and re-open it, it shows my workspace for 1 second or less and then shows the login screen.I use Fedora but I have seen it in Ubuntu too.
My expected behavior is not to show my workspace and windows, and to directly show the login screen.
Is it a bug? If not, Why does it have this behavior?