From e6787c60aa1c10fe2093a0f34a374e30d361a36a Mon Sep 17 00:00:00 2001 From: Bert Verhelst Date: Thu, 1 Oct 2026 20:24:25 +0200 Subject: [PATCH] Fix opening files via "Open with" (D-Bus activation) PyGObject calls the GApplication open vfunc with (files, n_files, hint), but do_open only accepted (files, hint). Because the app is DBusActivatable, file managers deliver files through org.freedesktop.Application.Open, which raised a TypeError, so no window opened and the service exited after its idle timeout. Co-Authored-By: Claude Opus 5.5 --- gradia/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradia/main.py b/gradia/main.py index 10cf43ca..6e3a5364 100644 --- a/gradia/main.py +++ b/gradia/main.py @@ -146,7 +146,7 @@ def _print_help(self): contents = stream.read_bytes(4096, None).get_data().decode("utf-8") print(contents) - def do_open(self, files: Sequence[Gio.File], hint: str): + def do_open(self, files: Sequence[Gio.File], n_files: int, hint: str): logging.debug(f"do_open called with files: {[file.get_path() for file in files]} and hint: {hint}") for file in files: path = file.get_path()