Downstream bug report: https://bugs.kde.org/show_bug.cgi?id=381160#c4
(From comment #4 of above report)
"xdg-screensaver is a script that does different things for each desktop.
The one that tries to use the standard fd.o interface is just completely wrong.
From the spec:
"Inhibition will stop when the UnInhibit function is called, or the application disconnects from the D-Bus session bus (which usually happens upon exit)."
dbus-send (called from the xdg-screensaver script) exits immediately after sending
We follow the fd.o spec so correctly remove the inhibition.
xdg-screensaver needs fixing, not plasma."
I am using version 1.1.2, but I could not fill that in the version field, as the option was missing.
I *think* that's what the 'track_window' function's purpose is.
That said, cannot speak for for how well or if it works as it should
This essentially renders xdg-screensaver completely useless on KDE, and thus programs which depend on xdg-screensaver working to inhibit the screensaver such as mpv's current git HEAD fail to inhibit the lock screen. I think the original downstream report does not stress this point enough.
the problem is that screensaver_freedesktop reset suffers from Bad Copy and Paste Programming. it is supposed to call org.freedesktop.ScreenSaver.SimulateUserActivity like screensaver_gnome_screensaver reset, but instead was copy and pasted from screensaver_freedesktop resume. therefore, it performs the wrong operation and uninhibits the display (resume) instead of stopping the screensaver (reset).