Hi there! Finally the selection riddle is clear: there were some GTK+ warnings very seldomly appearing sometimes, but not in 0.7.3. In 0.7.3 one of the popups was being set as the permanent owner for all the selections, and it was initialized at browser window creation time. As 0.7.3 leaked the popups (not destroying them with the window) the widget remained valid all the time! In CVS the popup leak is fixed, so the selection owner can be destroyed with its window, and thus the warnings. I fixed it like I originally suggested:
Perhaps it'd be better to add a widget parameter to a_Commands_set_selection:
void a_Commands_set_selection(GtkWidget *widget, gchar *str)
So we can set the owner properly. AFAIU the owner gets the "clear selection" event on the handler it set. For instance, when the user selects text from the location bar, the "clear selection" callback is called. This can help to set a custom handler for when the selected text comes from the rendered area. This new handler can toggle the selection highlighting off, and then call a_Commands_clear_selection_callback() to finish the work.
Sebastian: I used "GTK_BIN(bw->docwin)->child" as the selection owner for the rendered area. Is there a better candidate? Commited! Cheers Jorge.-