[Commits] [SCM] claws branch, gtk3, updated. 4.0.0-386-g82e0e7751

paul at claws-mail.org paul at claws-mail.org
Fri Dec 17 12:07:34 UTC 2021


The branch, gtk3 has been updated
       via  82e0e7751a18ecef39e0bbad89d74cb23639f4dc (commit)
      from  03b2cb8e0c6ff619e3be1fe272e74418d955b60e (commit)

Summary of changes:
 src/action.c                      |  2 +-
 src/compose.c                     |  3 ++-
 src/editaddress.c                 |  6 ++++--
 src/gtk/gtkaspell.c               |  3 ++-
 src/gtk/inputdialog.c             |  3 ++-
 src/plugins/python/python-shell.c | 29 ++++++++---------------------
 6 files changed, 19 insertions(+), 27 deletions(-)


- Log -----------------------------------------------------------------
commit 82e0e7751a18ecef39e0bbad89d74cb23639f4dc
Author: paul <paul at claws-mail.org>
Date:   Fri Dec 17 12:07:30 2021 +0000

    where GDK_KEY_Return is accepted, also accept GDK_KEY_KP_Enter

diff --git a/src/action.c b/src/action.c
index 53bf3f5a1..76d46b808 100644
--- a/src/action.c
+++ b/src/action.c
@@ -1149,7 +1149,7 @@ static gint io_dialog_key_pressed_cb(GtkWidget *widget, GdkEventKey *event,
 {
 	if (event && (event->keyval == GDK_KEY_Escape ||
 		      event->keyval == GDK_KEY_Return ||
-			  event->keyval == GDK_KEY_KP_Enter))
+		      event->keyval == GDK_KEY_KP_Enter))
 		hide_io_dialog_cb(widget, data);
 	return TRUE;
 }
diff --git a/src/compose.c b/src/compose.c
index 066eef152..0011a5e75 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9600,7 +9600,8 @@ static gboolean attach_property_key_pressed(GtkWidget *widget,
 		*cancelled = TRUE;
 		gtk_main_quit();
 	}
-	if (event && event->keyval == GDK_KEY_Return) {
+	if (event && (event->keyval == GDK_KEY_KP_Enter ||
+	    event->keyval == GDK_KEY_Return)) {
 		*cancelled = FALSE;
 		gtk_main_quit();
 		return TRUE;
diff --git a/src/editaddress.c b/src/editaddress.c
index 3059b8b1f..60638f116 100644
--- a/src/editaddress.c
+++ b/src/editaddress.c
@@ -1163,7 +1163,8 @@ static void edit_person_entry_email_changed (GtkWidget *entry, gpointer data)
 
 static gboolean edit_person_entry_email_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-	if (event && event->keyval == GDK_KEY_Return) {
+	if (event && (event->keyval == GDK_KEY_KP_Enter ||
+	    event->keyval == GDK_KEY_Return)) {
 		if (email_saving)
 			edit_person_email_modify(NULL);		
 		else if (email_adding)
@@ -1406,7 +1407,8 @@ static void edit_person_entry_att_changed (GtkWidget *entry, gpointer data)
 
 static gboolean edit_person_entry_att_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data)
 {
-	if (event && event->keyval == GDK_KEY_Return) {
+	if (event && (event->keyval == GDK_KEY_KP_Enter ||
+	    event->keyval == GDK_KEY_Return)) {
 		if (attrib_saving)
 			edit_person_attrib_modify(NULL);
 		else if (attrib_adding)
diff --git a/src/gtk/gtkaspell.c b/src/gtk/gtkaspell.c
index 3d306efd5..524198970 100644
--- a/src/gtk/gtkaspell.c
+++ b/src/gtk/gtkaspell.c
@@ -1404,7 +1404,8 @@ static gboolean replace_key_pressed(GtkWidget *widget,
 	if (event && event->keyval == GDK_KEY_Escape) {
 		gtk_widget_destroy(widget);
 		return TRUE;
-	} else if (event && event->keyval == GDK_KEY_Return) {
+	} else if (event && (event->keyval == GDK_KEY_KP_Enter ||
+		   event->keyval == GDK_KEY_Return)) {
 		replace_with_supplied_word_cb(widget, gtkaspell);
 		return TRUE;
 	}
diff --git a/src/gtk/inputdialog.c b/src/gtk/inputdialog.c
index 1312dd839..bc458e37e 100644
--- a/src/gtk/inputdialog.c
+++ b/src/gtk/inputdialog.c
@@ -506,7 +506,8 @@ static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event, gpointer data
 	if (event && event->keyval == GDK_KEY_Escape) {
 		ack = FALSE;
 		fin = TRUE;
-	} else if (event && event->keyval == GDK_KEY_Return) {
+	} else if (event && (event->keyval == GDK_KEY_KP_Enter ||
+		   event->keyval == GDK_KEY_Return)) {
 		ack = TRUE;
 		fin = TRUE;
 		return TRUE; /* do not let Return pass - it
diff --git a/src/plugins/python/python-shell.c b/src/plugins/python/python-shell.c
index 626af1e62..faf9f2ab0 100644
--- a/src/plugins/python/python-shell.c
+++ b/src/plugins/python/python-shell.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2008-2009  Christian Hammond
  * Copyright (c) 2008-2009  David Trowbridge
+ * Copyright (C) 2021 the Claws Mail Team
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -334,25 +335,20 @@ parasite_python_shell_key_press_cb(GtkWidget *textview,
                                    GdkEventKey *event,
                                    GtkWidget *python_shell)
 {
-    if (event->keyval == GDK_KEY_Return)
+    if (event && (event->keyval == GDK_KEY_KP_Enter ||
+	event->keyval == GDK_KEY_Return))
     {
         parasite_python_shell_process_line(python_shell);
         return TRUE;
-    }
-    else if (event->keyval == GDK_KEY_Up)
-    {
+    } else if (event && event->keyval == GDK_KEY_Up) {
         parasite_python_shell_replace_input(python_shell,
             parasite_python_shell_get_history_back(python_shell));
         return TRUE;
-    }
-    else if (event->keyval == GDK_KEY_Down)
-    {
+    } else if (event && event->keyval == GDK_KEY_Down) {
         parasite_python_shell_replace_input(python_shell,
             parasite_python_shell_get_history_forward(python_shell));
         return TRUE;
-    }
-    else if (event->string != NULL)
-    {
+    } else if (event && event->string != NULL) {
         ParasitePythonShellPrivate *priv =
             PARASITE_PYTHON_SHELL_GET_PRIVATE(python_shell);
         GtkTextBuffer *buffer =
@@ -379,27 +375,18 @@ parasite_python_shell_key_press_cb(GtkWidget *textview,
                                                   &selection_iter);
 
         if (cmp_start_insert == 0 && cmp_start_select == 0 &&
-            (event->keyval == GDK_KEY_BackSpace ||
-             event->keyval == GDK_KEY_Left))
-        {
+            event && (event->keyval == GDK_KEY_BackSpace ||
+             event->keyval == GDK_KEY_Left)) {
             return TRUE;
         }
         if (cmp_start_insert <= 0 && cmp_start_select <= 0)
-        {
             return FALSE;
-        }
         else if (cmp_start_insert > 0 && cmp_start_select > 0)
-        {
             gtk_text_buffer_place_cursor(buffer, &start_iter);
-        }
         else if (cmp_insert_select < 0)
-        {
             gtk_text_buffer_move_mark(buffer, insert_mark, &start_iter);
-        }
         else if (cmp_insert_select > 0)
-        {
             gtk_text_buffer_move_mark(buffer, selection_mark, &start_iter);
-        }
     }
 
     return FALSE;

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list