chat window keybindings
Submitted by Brian J. Murrell
Link to original bug (#576075)
Description
The keybindings in the chat window are not assignable by .gtkrc. I have attempted a patch to make them work, and while I think it's pretty close, it's not quite there. I'm not familiar enough with GTK to understand why. Here's the patch:
--- empathy-2.25.92.orig/libempathy-gtk/empathy-chat.c
+++ empathy-2.25.92/libempathy-gtk/empathy-chat.c
@@ -707,6 +707,7 @@
return TRUE;
}
+#if 0 /* Catch enter but not ctrl/shift-enter */ if (IS_ENTER (event->keyval) && !(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK))) { @@ -727,6 +728,7 @@ chat_input_text_view_send (chat); return TRUE; } +#endif
text_view_sw = gtk_widget_get_parent (GTK_WIDGET (chat->view));
@@ -1275,6 +1277,7 @@ GList *list = NULL; gchar *filename; GtkTextBuffer *buffer;
-
GtkBindingSet *binding_set; filename = empathy_file_lookup ("empathy-chat.glade", "libempathy-gtk");
@@ -1311,6 +1314,7 @@ "left-margin", 2, "wrap-mode", GTK_WRAP_WORD_CHAR, NULL);
-
gtk_widget_set_name(chat->input_text_view, "empathy_input_text_view"); g_signal_connect (chat->input_text_view, "key-press-event", G_CALLBACK (chat_input_key_press_event_cb), chat);
@@ -1323,6 +1327,11 @@ g_signal_connect (chat->input_text_view, "populate-popup", G_CALLBACK (chat_input_populate_popup_cb), chat);
-
g_signal_connect (chat->input_text_view, "message_send",
-
G_CALLBACK (chat_input_text_view_send),
-
chat);
-
binding_set = gtk_binding_set_by_class ((G_OBJECT_GET_CLASS(G_OBJECT(chat->input_text_view))));
-
gtk_binding_entry_add_signal (binding_set, GDK_KP_Enter, 0, "message_send", 0); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (chat->input_text_view)); g_signal_connect (buffer, "changed", G_CALLBACK (chat_input_text_buffer_changed_cb),
Probably this use of keybindings needs to be expanded to other aspects of empathy, but I don't know of any specific examples off the top of my head.
Version: 2.26.x