Each time I suspend my computer, after I turn it back on, the last screen state before suspension shows up in the blink of an eye - showing possibly web pages, terminals, applications etc. -, then the lock screen shows up and a password is required to access my computer.
I am using Ubuntu 18 but I encountered the same behavior with the former versions.
In most cases this can be seen as a minor problem but sometimes this can lead to some confidentiality issues.
Do you know why this is occurring and if it is possible to prevent it?
X11 automatic screenlocking is always risky. The only safe way to ensure your screen is locked when you resume is to lock your screen manually before suspending.