[Commits] [SCM] claws branch, gtk2, updated. 3.19.1-99-ga2255922f

paul at claws-mail.org paul at claws-mail.org
Fri Nov 17 15:30:13 UTC 2023


The branch, gtk2 has been updated
       via  a2255922fc9fe7afedc6cbb25cf36d172841d282 (commit)
      from  17f19e4efa7cd1fe4b29a4d496d22680deaa835c (commit)

Summary of changes:
 src/compose.c                    | 11 ++++++-----
 src/plugins/dillo/dillo_viewer.c |  9 +++++++--
 2 files changed, 13 insertions(+), 7 deletions(-)


- Log -----------------------------------------------------------------
commit a2255922fc9fe7afedc6cbb25cf36d172841d282
Author: Paul <paul at claws-mail.org>
Date:   Fri Nov 17 15:27:17 2023 +0000

    fix bug 4361, 'Embedding external editor crashes Claws-Mail on Wayland' and a similar crash with the dillo plugin

diff --git a/src/compose.c b/src/compose.c
index d912c459a..59b938d5b 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9675,7 +9675,7 @@ static void compose_exec_ext_editor(Compose *compose)
 		return;
 	}
 
-	if (compose_get_ext_editor_uses_socket()) {
+	if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
 #ifndef G_OS_WIN32
 		/* Only allow one socket */
 		if (compose->exteditor_socket != NULL) {
@@ -9702,10 +9702,11 @@ static void compose_exec_ext_editor(Compose *compose)
 		g_free(tmp);
 		return;
 #endif /* G_OS_WIN32 */
-	}
+	} else
+		debug_print("Socket communication with an external editor is only available on X11.\n");
 
 	if (compose_get_ext_editor_cmd_valid()) {
-		if (compose_get_ext_editor_uses_socket()) {
+		if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
 #ifndef G_OS_WIN32
 			p = g_strdup(prefs_common_get_ext_editor_cmd());
 			s = strstr(p, "%w");
@@ -9803,7 +9804,7 @@ static void compose_ext_editor_closed_cb(GPid pid, gint exit_status, gpointer da
 	compose->exteditor_file    = NULL;
 	compose->exteditor_pid     = INVALID_PID;
 	compose->exteditor_tag     = -1;
-	if (compose->exteditor_socket) {
+	if (compose->exteditor_socket && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
 		gtk_widget_destroy(compose->exteditor_socket);
 		compose->exteditor_socket = NULL;
 	}
@@ -9914,7 +9915,7 @@ static void compose_set_ext_editor_sensitive(Compose *compose,
 			ext_editor_menu_entries[i], sensitive);
 	}
 
-	if (compose_get_ext_editor_uses_socket()) {
+	if (compose_get_ext_editor_uses_socket() && GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
 		if (sensitive) {
 			if (compose->exteditor_socket)
 				gtk_widget_hide(compose->exteditor_socket);
diff --git a/src/plugins/dillo/dillo_viewer.c b/src/plugins/dillo/dillo_viewer.c
index b41cc353f..f131d35c6 100644
--- a/src/plugins/dillo/dillo_viewer.c
+++ b/src/plugins/dillo/dillo_viewer.c
@@ -1,6 +1,6 @@
 /*
- * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2012 the Claws Mail Team
+ * Claws Mail -- a GTK based, lightweight, and fast e-mail client
+ * Copyright (C) 1999-2023 the Claws Mail Team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -124,6 +124,11 @@ static void dillo_show_mimepart(MimeViewer *_viewer,
 		g_free(viewer->filename);
 	}
 
+	if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) {
+		debug_print("dillo viewer only works on X11\n");
+		return;
+	}
+
 	viewer->filename = procmime_get_tmp_file_name(partinfo);
 	
 	if (!(procmime_get_part(viewer->filename, partinfo) < 0)) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list