Yes, part of it is the inhibitor API although IIRC there are some other parts. GDM and GNOME share the same implementation of this API so they should at least do the right thing, not sure about other desktops and login managers.
Edit: The other part is the device handling logic in logind: https://www.freedesktop.org/software/systemd/man/org.freedes...
Older tools which may use suid helpers to open these devices will probably stomp all over the logind handling.