]> git.babelmonkeys.de Git - jubjub.git/commitdiff
JubGtkChat: Hook 'activate' instead of 'key_release_event'
authorFlorian Zeitz <florob@babelmonkeys.de>
Mon, 18 Feb 2013 21:00:33 +0000 (22:00 +0100)
committerFlorian Zeitz <florob@babelmonkeys.de>
Mon, 18 Feb 2013 21:00:33 +0000 (22:00 +0100)
src/gui/gtk/JubGtkChatUI.m

index 975a08d21b8252360930ad8b7582acee1fa4e659..bf130a9879f42c17a56bb75a3e099f38045b3000 100644 (file)
@@ -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),