Brave prevents screen turn off

When I have the problem on my Linux Mint XFCE 22.2 laptop with latest Brave update:-

If you do a:-

dbus-send --print-reply --dest=org.freedesktop.PowerManagement /org/freedesktop/PowerManagement/Inhibit org.freedesktop.PowerManagement.Inhibit.GetInhibitors

You get:-

method return time=1766140932.750127 sender=:1.532 → destination=:1.782 serial=236 reply_serial=2
array [
string “/opt/brave.com/brave/brave”
]

If you look at brave and are say, playing a youtube video, you get a “sound icon” in the tab and string “/opt/brave.com/brave/brave” is shown in the above command. Stop playing the video and the string “/opt/brave.com/brave/brave” disappears.

If you have outlook.live.com as a tab (checking email) you will sometimes see a dot saying new mail. This also seams to sometimes create the string “/opt/brave.com/brave/brave”.

This is how you can replicate the problem:-

If you open a .pdf in brave (with brave as your default pdf viewer) and press the download button you can get the string “/opt/brave.com/brave/brave”

If you want to clear the Inhibitors without logging out or rebooting you can do the following:-

xfce4-power-manager --restart

If you the press the download button multiple times you should get the string “/opt/brave.com/brave/brave” multiple times showing in the inhibitors again.

If you close the pdf tab you could still have string “/opt/brave.com/brave/brave” multiple times showing in the inhibitors again.

If you close the browser you could still have string “/opt/brave.com/brave/brave” multiple times showing in the inhibitors again.

THIS IS THE PROBLEM.

but to clear the problem without having to log out or reboot :-

xfce4-power-manager --restart

This does not fix the problem. If you have not noticed it and thus clear, you laptop will not go to sleep because of the inhibitors.