[Commits] [SCM] claws branch, master, updated. 4.1.1-116-gad77f62cf

paul at claws-mail.org paul at claws-mail.org
Fri Nov 17 15:27:23 UTC 2023


The branch, master has been updated
       via  ad77f62cf69eb1dd5ca50ec341eead5c01251475 (commit)
      from  40a7c311bfcad7f7ac5b63fcd29f56cb7a726ec0 (commit)

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


- Log -----------------------------------------------------------------
commit ad77f62cf69eb1dd5ca50ec341eead5c01251475
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 962c5d384..574d89be1 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9643,7 +9643,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) {
@@ -9670,10 +9670,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");
@@ -9775,7 +9776,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;
 	}
@@ -9886,7 +9887,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 f90d54b39..d2690bff6 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
+ * 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
@@ -125,6 +125,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