[Pidgin] #11712: Message Notification Plugin does not open/present chatroom window

Pidgin trac at pidgin.im
Wed Aug 20 23:37:19 EDT 2014


#11712: Message Notification Plugin  does not open/present chatroom window
------------------------+----------------------
 Reporter:  thanson114  |       Owner:
     Type:  defect      |      Status:  new
Milestone:              |   Component:  plugins
  Version:  2.6.6       |  Resolution:
 Keywords:              |
------------------------+----------------------

Comment (by tmatz):

 I succeeded reproduce the crash bug reported in #8911,
 and confirm previously posted patch fixes this problem correctly.

 Condition is that:

 * comment out "if" statement in handle_present().
 * "Close IMs immediately" option is disabled.
 * Notify plugin's "Focused windows" option is enabled.
 * Notify plugin's "Present conversation window" option is enabled.

 When closing conversation window, crash occurs.

 When closing conversation window, because "Close IMs immediately" is
 disabled,
 the conversation is moved to the hidden Pidgin Window for holding it.

 In pidgin_conv_window_add_gtkconv(), if the hidden Pidgin Window is empty
 at that
 moment, gtk_notebook_set_current_page() is called, and switch_conv_cb() is
 callbacked,
 then "conversation-switched" event occurs.

 Notify plugin's conv_switched() is callbacked,
 and because "Present conversation window" option is enabled,
 handle_present() is called.
 purple_conversation_present() is called, and then the conversation is
 removed from
 the hidden Pidgin Window.

 After that, execution is returned back in
 pidgin_conv_window_add_gtkconv(),
 gtk_notebook_get_current_page() is called and it returns -1.
 Then focus_gtkconv is set null, and program crashs by segmentation fault.

 {{{
         if (pidgin_conv_window_get_gtkconv_count(win) == 1) {
                 /* Er, bug in notebooks? Switch to the page manually. */
                 gtk_notebook_set_current_page(GTK_NOTEBOOK(win->notebook),
 0);
         } else {
                 gtk_notebook_set_show_tabs(GTK_NOTEBOOK(win->notebook),
 TRUE);
         }

         focus_gtkconv =
 g_list_nth_data(pidgin_conv_window_get_gtkconvs(win),
 gtk_notebook_get_current_page(GTK_NOTEBOOK(
 win->notebook)));
         gtk_widget_grab_focus(focus_gtkconv->entry);
 }}}


 IMHO, issuing "conversation-switched" event for hidden conversation is
 essential problem.

 There is other situation that problem occurs.
 When the hidden Pidgin Window has some hidden conversations, and the
 current conversation
 becomes visible, it is removed from the hidden Pidgin Window, and next
 hidden conversation
 becomes current, then "conversation-switched" event occurs.

 if this event is not ignored, conversation becomes present even if it does
 not receive message.

--
Ticket URL: <https://developer.pidgin.im/ticket/11712#comment:3>
Pidgin <https://pidgin.im>
Pidgin


More information about the Tracker mailing list