adji

Adji's a Decisive and Joyful Internet browser
git clone https://noxz.tech/git/adji.git
Log | Files | Tags | LICENSE

commit: 8e45b43fd294d85d30c958e81e0dd8d47ca7ebc4
parent: 25a012501935d75b91a2e58240a66b084ae3cef7
author: Chris Noxz <chris@noxz.tech>
date:   Thu, 28 Dec 2023 19:25:37 +0100
do not open download until finished
Mbrowser.h5+++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/browser.h b/browser.h
@@ -312,14 +312,15 @@ cb_download_press(GtkWidget                   *btn,
                   gpointer                     data)
 {
 	switch (event->button) {
-	case 2: /* middle button: cancel and/or remove */
+	case 2: /* middle click: cancel and/or remove */
 		if (!(*((gboolean*)g_object_get_data(G_OBJECT(btn), __NAME__"-finished"))))
 			webkit_download_cancel(WEBKIT_DOWNLOAD(data));
 		g_object_unref(WEBKIT_DOWNLOAD(data));
 		gtk_widget_destroy(btn);
 		break;
 	case 1: /* left click: open downloaded file */
-		xdg_open("", webkit_download_get_destination(WEBKIT_DOWNLOAD(data)));
+		if ((*((gboolean*)g_object_get_data(G_OBJECT(btn), __NAME__"-finished"))))
+			xdg_open("", webkit_download_get_destination(WEBKIT_DOWNLOAD(data)));
 		break;
 	}
 }