GNOME Bugzilla – Bug 576075
chat window keybindings
Last modified: 2018-05-22 13:23:28 UTC
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.
Thank you for reporting this, and thank you for the patch! Sorry you haven't received a response yet. If you haven't already talked with the developers about this, you should check out our developer resources/guidelines -- that'll make it easier for us to review your patch: http://live.gnome.org/Empathy http://live.gnome.org/Empathy/Git
(In reply to comment #1) > Thank you for reporting this, and thank you for the patch! You are welcome. > Sorry you haven't > received a response yet. Yes, it has been a while, and TBH, it's so long ago that I've lost interest. One can only stay interested in something, waiting patiently for input for so long, and one finally gives up, moves on, and gets on with life. > If you haven't already talked with the developers about this, you should check > out our developer resources/guidelines -- that'll make it easier for us to > review your patch: I tried to talk to developers about this back when I was working on it. Nobody seemed too much interested. But this was my itch after-all an not anyone else's (evidently). That said, pidgin does what this patch tried to make Empathy do. Pidgin also handles IRC (which is 80% of what I use pidgin for) a lot better than Empathy, which, back when I was evaluating it pretty much treated IRC as a third class citizen, not even allowing the input of / commands. I believe this latter situation is still the case. That said, I'm pretty happy with pidgin for the moment, and the new version, with gnome 2.28 even has voice and video, which was my only reason for looking at Empathy. Moreover, I don't really have time to hack on software I wouldn't even likely use (at least until this problem and the IRC situation is resolved). Hopefully somebody else has this same itch for configurable chat window bindings and can leverage on my effort and this feature can finally be complete.
Reopening as I can't see any open question.
*** Bug 613665 has been marked as a duplicate of this bug. ***
Bug 613665 has a patch using an accel_group which is probably the way forward here, though it needs porting to empathy-individual-menu.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/empathy/issues/52.