# HG changeset patch # User Daniel Atallah # Date 1118294276 0 # Node ID 56cfc50d2a81fd7af5f438cae18378065ee6c046 # Parent 9a397c8586399c4a054886b3c0c41c91962d7248 [gaim-migrate @ 12841] Fix the right-click menus on the tags disappearing when mouse released. Rlaager also noticed that if the buddy name contains an escaped entity, the offsets are screwy - fix that too. committer: Tailor Script diff -r 9a397c858639 -r 56cfc50d2a81 src/gtkconv.c --- a/src/gtkconv.c Thu Jun 09 05:17:11 2005 +0000 +++ b/src/gtkconv.c Thu Jun 09 05:17:56 2005 +0000 @@ -4826,8 +4826,9 @@ menu = create_chat_menu(conv, buddyname, prpl_info, gc); gtk_menu_popup(GTK_MENU(menu), NULL, NULL, - NULL, GTK_WIDGET(imhtml), 3, - GDK_CURRENT_TIME); + NULL, GTK_WIDGET(imhtml), + btn_event->button, + btn_event->time); /* Don't propagate the event any further */ return TRUE; @@ -4936,7 +4937,10 @@ } else { char *new_message = g_memdup(message, length); char *who_escaped = (who ? g_markup_escape_text(who, strlen(who)) : g_strdup("")); - int tag_start_offset = 0, tag_end_offset = 0; + /* The initial offset is to deal with + * escaped entities making the string longer */ + int tag_start_offset = (who ? (strlen(who_escaped) - strlen(who)) : 0); + int tag_end_offset = 0; if (flags & GAIM_MESSAGE_WHISPER) { str = g_malloc(1024); @@ -4945,11 +4949,11 @@ if (gaim_message_meify(new_message, -1 )) { g_snprintf(str, 1024, "***%s", who_escaped); strcpy(color, "#6C2585"); - tag_start_offset = 3; + tag_start_offset += 3; } else { g_snprintf(str, 1024, "*%s*:", who_escaped); - tag_start_offset = 1; + tag_start_offset += 1; tag_end_offset = 2; strcpy(color, "#00FF00"); } @@ -4960,11 +4964,11 @@ if (flags & GAIM_MESSAGE_AUTO_RESP) { g_snprintf(str, 1024, "%s ***%s", AUTO_RESPONSE, who_escaped); - tag_start_offset = 4 + tag_start_offset += 4 + strlen(AUTO_RESPONSE); } else { g_snprintf(str, 1024, "***%s", who_escaped); - tag_start_offset = 3; + tag_start_offset += 3; } if (flags & GAIM_MESSAGE_NICK) @@ -4976,7 +4980,7 @@ str = g_malloc(1024); if (flags & GAIM_MESSAGE_AUTO_RESP) { g_snprintf(str, 1024, "%s %s", who_escaped, AUTO_RESPONSE); - tag_start_offset = 1 + tag_start_offset += 1 + strlen(AUTO_RESPONSE); } else { g_snprintf(str, 1024, "%s:", who_escaped);