# HG changeset patch # User Mark Doliner # Date 1057553076 0 # Node ID c062c4bf58ac85a779ae5ede9d81e7c2158e5e6b # Parent a170c50b2a48aa349711ecac22f3a1abbd5f91d5 [gaim-migrate @ 6502] Should fix the ctrl+a/ctrl+home/ctrl+end crashes. committer: Tailor Script diff -r a170c50b2a48 -r c062c4bf58ac src/gtkconv.c --- a/src/gtkconv.c Mon Jul 07 02:59:13 2003 +0000 +++ b/src/gtkconv.c Mon Jul 07 04:44:36 2003 +0000 @@ -1402,6 +1402,35 @@ } /* + * This function exists to work around some gross bugs in GtkTextView. + * Basically, we short circuit ctrl+a and ctrl+end because they make + * Gaim go boom. + * + * It's supposed to be fixed in gtk2.2. You can view the bug report at + * http://bugzilla.gnome.org/show_bug.cgi?id=107939 + */ +static gboolean +textview_key_pressed_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) +{ + if (event->state & GDK_CONTROL_MASK) + switch (event->keyval) { + case 'a': + return TRUE; + break; + + case GDK_Home: + return TRUE; + break; + + case GDK_End: + return TRUE; + break; + } + + return FALSE; +} + +/* * NOTE: * This guy just kills a single right click from being propagated any * further. I have no idea *why* we need this, but we do ... It @@ -3544,6 +3573,10 @@ 25)); /* Connect the signal handlers. */ + /* XXX - This first one should be removed eventually. It exists to + * work around a gtk bug. See the callback comments for more info. */ + g_signal_connect(G_OBJECT(gtkconv->imhtml), "key_press_event", + G_CALLBACK(textview_key_pressed_cb), conv); g_signal_connect_swapped(G_OBJECT(gtkconv->entry), "key_press_event", G_CALLBACK(entry_key_pressed_cb_1), gtkconv->entry_buffer); diff -r a170c50b2a48 -r c062c4bf58ac src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Mon Jul 07 02:59:13 2003 +0000 +++ b/src/protocols/oscar/oscar.c Mon Jul 07 04:44:36 2003 +0000 @@ -6063,10 +6063,11 @@ char *buf = g_malloc(st.st_size); file = fopen(iconfile, "rb"); if (file) { + md5_state_t *state; char md5[16]; int len = fread(buf, 1, st.st_size, file); fclose(file); - md5_state_t *state = g_malloc(sizeof(md5_state_t)); + state = g_malloc(sizeof(md5_state_t)); md5_init(state); md5_append(state, buf, len); md5_finish(state, md5);