From 7fac8604c41ad401c492af87ae0dbf04dd06eacc Mon Sep 17 00:00:00 2001 From: wayne Date: Wed, 19 Aug 2026 21:03:23 +1000 Subject: [PATCH] screenshot-manager: don't wedge on a failed screencopy maybe_screencopy_done() completed the D-Bus invocation itself on the failure path and returned without disposing self->frames. Two things follow from that. An internally requested screenshot -- the power button, or anything else reaching phosh_screenshot_manager_take_screenshot() with a NULL invocation -- has nothing to complete, so it tripped g_dbus_method_invocation_return_value_internal: assertion 'G_IS_DBUS_METHOD_INVOCATION (invocation)' failed And since self->frames stayed set -- on every failure path, not just the internal one -- phosh_screenshot_manager_do_screenshot() refused every later request with "Screenshot already in progress". So one failed screenshot disabled screenshots until phosh was restarted. screenshot_done() already handles both cases: it completes the invocation only when there is one, and disposes the frames either way. Route the failure through it. Reproduced on a FuriPhone FLX1 by shooting with the screen blanked, where wlr screencopy cannot read the output. The first request logged "Failed to copy output 'HWCOMPOSER-1'" and the assertion above; every request after it returned (false, '') immediately, without reaching screencopy at all. --- src/screenshot-manager.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/screenshot-manager.c b/src/screenshot-manager.c index f5b72f007..d6f5e464e 100644 --- a/src/screenshot-manager.c +++ b/src/screenshot-manager.c @@ -729,10 +729,7 @@ maybe_screencopy_done (PhoshScreenshotManager *self) /* With a failure no need to merge pixbufs */ if (failed) { - phosh_dbus_screenshot_complete_screenshot (PHOSH_DBUS_SCREENSHOT (self), - self->frames->invocation, - FALSE, - self->frames->filename ?: ""); + screenshot_done (self, FALSE); return; }