Bug Description

Without this fix, power cycling a monitor bypasses the screen lock. This upload also includes much improved translations.

[Test Case]

After installing this fix, run through the following procedure:
- Lock Screen
- Turn off monitor
- Turn monitor on
- Start typing

See the original bug description below for a more detailed test case.

[Regression Potential]

Since this cleans up some GdkScreen deprecations, if the underlying GdkScreen is updated, this could regress once more.

Additionally, this changes the function name for detecting if the monitor has changed and adds a new one, so if a library or package depends on the internal functions of mate-screensaver for some reason, there will be breakage.

after killall mate-screensaver:
Screensaver is not running!
After re-running mate-screensaver:
The screensaver is inactive
The screensaver is not inhibited
After locking (stays this way forever even while using the computer)
The screensaver is active
The screensaver is not inhibited
Same as above, annotated with logs: (attached for ease of reading)
mate-screensaver --no-daemon --debug
mate-screensaver-1.txt

Wait 9 seconds (that's how long it takes monitor to boot)
Can see and use screen/type/etc; it is (effectively) unlocked.
dmesg-5.txt

(there is no dmesg-1.txt or dmesg-2.txt or mate-screensaver-5.txt (blank during that time))

Troubleshooting
This occurred on two machines.

Home Machine
Problem occurred on Ubuntu 16.04 (do not have logs unfortunately)
Unsure what version of mate it was at the time
If relevant
monitor was 2560x1600
Uses nvidia drivers
Upgrading to Ubuntu 18.04 (which upgraded mate to 1.20.0) fixed the problem on home machine.
Work Machine
Problem occurred on Ubuntu 17.10 (mate 1.18) (do not have logs unfortunately)
Upgrading to Ubuntu 18.04 (mate 1.20.0) did NOT fix the problem.
If relevant
monitor is 3840x2160
Problem still occurs if I switch to different resolution
Has no dedicated video card/using intel onboard graphics
monitor is a USB hub.. problem still reproduces if I disconnect the usb cable and have the keyboard connected some other way.
Please let me know what other logs/steps may be useful.

MATE general version
1.20.0

Package version
mate-screensaver 1.20.0-1
See attached
mate-packages.txt
for full list of all mate-related package versions

Re: "UpgradeStatus: No upgrade log present (probably fresh install)"
I didn't use `do-release-upgrade` by mistake.
I changed `artful` to `bionic` in sources.list and slowly did dist-upgrade carefully. I didn't realize that would actually be considered an upgrade and I could not do `do-release-upgrade` afterwards.

Please let me know if there is anything I can add (from work or home machine) that might help track this down.

Thanks for taking the time to report this bug and helping to make Ubuntu better. Since the package referred to in this bug is in universe or multiverse, it is community maintained. If you are able, I suggest coordinating with upstream and posting a debdiff for this issue. When a debdiff is available, members of the security team will review it and publish the package. See the following link for more information: https://wiki.ubuntu.com/SecurityTeam/UpdateProcedures

AFAIC this is a pretty high-profile security issue, and may not very prudent to leave open for months after it's fixed upstream. Imagine the storm of bad press if Microsoft or Apple were to pull something like this - or even if this bug report catches the eye of the wrong people...

I had this problem today with a TV plugged into HDMI on 18.04.1 Mate (mate-screensaver 1.20.0-1). How to track the progress of the patch in SRU 18.04? How to check that a machine with 18.04 will be patched?

So what's up with this security issue?
I've reported it to mate-desktop and they says that it is up to Ubuntu maintainers to release fixed version.https://github.com/mate-desktop/mate-screensaver/issues/180
It is a critical security issue and I had to switch to different window manager on my work laptop because this issue places my work laptop and thus my employer at risk. Require update for Ubuntu 18.04 ASAP!

I can confirm the updated mate-screensaver fixes the issue (somehow). There is still maybe half-second blink of visible desktop when I disconnect an external monitor from HDMI port while the screen is locked. After that, the screen is properly locked. Still, the quick blink of desktop is a security issue and it might also be possible for a malicious hacker to insert a USB device which emulates keyboard and might kill the screensaver completely while the screen blinks.