activity,screencast: replace silent-degrade DBus catches with observable probes
activity.py and screencast.py hid DBus probe failures behind broad
`except Exception: pass` and `return <literal>` fallbacks. Parser bugs,
bus-daemon dropouts, and timeouts all looked identical to "service not
present", which dropped operator signal and could silently flip
probe_activity_services() into always-capture mode when a real backend
was present but introspection broke.
Fix: inherit the doctor.check_portal pattern from 1629914. Service
presence probing now asks the bus daemon (org.freedesktop.DBus at
/org/freedesktop/DBus) whether a well-known name is owned via
NameHasOwner instead of introspecting each target service path. The
bus-daemon XML has no hyphenated members, so the parser bug does not
apply, and the code can distinguish "not registered" from "probe
broke".
This fixes seven sites: activity.probe_activity_services now uses
NameHasOwner against the bus daemon; activity.is_screen_locked narrows
both the FDO and GNOME fallback branches; activity.is_power_save_active
does the same for Mutter and KDE Solid; activity.get_monitor_geometries_kscreen
narrows its catch to concrete DBus/introspection failures; and
screencast.Screencaster._close_session now warns with the portal session
path instead of silently swallowing close failures.
One design choice is intentional: backend branches in the lock/power
fallback chains and KScreen suppress WARN logs when DBusError.type is
org.freedesktop.DBus.Error.ServiceUnknown or
org.freedesktop.DBus.Error.NameHasNoOwner. Without that, asymmetric
desktops such as vanilla GNOME (no KDE Solid) or KDE (no Mutter
DisplayConfig) would emit thousands of warnings per day from the 5s poll
loop. Any other probe failure stays loud: parser bugs, bus failures,
non-missing DBusError values, and close-session failures still warn.
_close_session and _name_has_owner log unconditionally because closing a
known session should work, and NameHasOwner returns False rather than
raising for truly missing services.
This closes the follow-up called out in the footer of 1629914, and adds
regression coverage for parser failures, broken backends, silent missing
services, and close-session logging.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>