From: Florian Zeitz Date: Mon, 18 Feb 2013 21:00:33 +0000 (+0100) Subject: JubGtkChat: Hook 'activate' instead of 'key_release_event' X-Git-Url: https://git.babelmonkeys.de/?a=commitdiff_plain;h=23c3cf6bc0f798059b9f9e40bc815ceb73be60d4;p=jubjub.git JubGtkChat: Hook 'activate' instead of 'key_release_event' --- diff --git a/src/gui/gtk/JubGtkChatUI.m b/src/gui/gtk/JubGtkChatUI.m index 975a08d..bf130a9 100644 --- a/src/gui/gtk/JubGtkChatUI.m +++ b/src/gui/gtk/JubGtkChatUI.m @@ -6,12 +6,9 @@ struct call_send_block_params { JubGtkChatUI *chat; }; -static gboolean call_send_block(GtkEntry *entry, GdkEventKey *event, - gpointer data) +static void call_send_block(GtkEntry *entry, gpointer data) { struct call_send_block_params *params = data; - if (event->keyval != GDK_KEY_Return && - event->keyval != GDK_KEY_KP_Enter) return TRUE; OFString *text = [[OFString alloc] initWithUTF8String: gtk_entry_get_text(entry)]; @@ -24,8 +21,6 @@ static gboolean call_send_block(GtkEntry *entry, GdkEventKey *event, } [text release]; - - return TRUE; } static void call_close_block(GtkWidget *object, gpointer data) @@ -74,7 +69,7 @@ static void call_close_block(GtkWidget *object, gpointer data) [self allocMemoryWithSize: sizeof(*send_params)]; send_params->block = sendBlock; send_params->chat = self; - g_signal_connect(chat_entry, "key_release_event", + g_signal_connect(chat_entry, "activate", G_CALLBACK(call_send_block), send_params); gtk_window_set_title(GTK_WINDOW(chat_window),