pidgin/pidgin

Fix the infinite resizing freeze
release-2.x.y
2022-04-15, Belgin Știrbu
0079467afee4
Fix the infinite resizing freeze

This appears related to libpango somehow, as in Debian
Bullseye, libpango splits URLs with dashes at the end,
but in Debian Bookworm, the URLs are not split with dashes
at the end, and the bug does not appear to be triggered
in Bookworm.

This patch makes the assumption that the gtkimhtml widgets
stored in a PidginConversation normally resize in an
alternating manner. However, when the bug is triggered,
only the "entry" gtkimhtml member of PidginConversation
resizes, so we allow "entry" to resize only up to 3 times
in a row.

Testing Done:
Compiled and tested on several desktop environments on a few
GNU/Linux distros by pasting the link mentioned
here https://issues.imfreedom.org/issue/PIDGIN-17413 moving
the cursor at the beginning of the buffer, and holding
the spacebar pressed.

Bugs closed: PIDGIN-16753, PIDGIN-16999, PIDGIN-17287, PIDGIN-17413, PIDGIN-17430, PIDGIN-17568, PIDGIN-17602

Reviewed at https://reviews.imfreedom.org/r/1342/
/** @page connection-signals Connection Signals
@signals
@signal signing-on
@signal signed-on
@signal autojoin
@signal signing-off
@signal signed-off
@signal connection-error
@endsignals
@see connection.h
<hr>
@signaldef signing-on
@signalproto
void (*signing_on)(PurpleConnection *gc);
@endsignalproto
@signaldesc
Emitted when a connection is about to sign on.
@param gc The connection that is about to sign on.
@endsignaldef
@signaldef signed-on
@signalproto
void (*signed_on)(PurpleConnection *gc);
@endsignalproto
@signaldesc
Emitted when a connection has signed on.
@param gc The connection that has signed on.
@endsignaldef
@signaldef autojoin
@signalproto
gboolean (*autojoin)(PurpleConnection *gc);
@endsignalproto
@signaldesc
Emitted when a connection has signed on, after the signed-on signal, to
signal UIs to autojoin chats if they wish. UIs should connect to this
with @c PURPLE_SIGNAL_PRIORITY_HIGHEST to allow plugins to block this
signal before the UI sees it and then re-emit it later.
@param gc The connection that has signed on.
@return @c TRUE if the signal was handled or @c FALSE otherwise. In
practice, the return value is irrelevant, as it really only
exists so plugins can block the UI's autojoin.
@since 2.7.0
@endsignaldef
@signaldef signing-off
@signalproto
void (*signing_off)(PurpleConnection *gc);
@endsignalproto
@signaldesc
Emitted when a connection is about to sign off.
@param gc The connection that is about to sign off.
@endsignaldef
@signaldef signed-off
@signalproto
void (*signed_off)(PurpleConnection *gc);
@endsignalproto
@signaldesc
Emitted when a connection has signed off.
@param gc The connection that has signed off.
@endsignaldef
@signaldef connection-error
@signalproto
void (*connection_error)(PurpleConnection *gc, PurpleConnectionError err, const gchar *desc)
@endsignalproto
@signaldesc
Emitted when a connection error occurs, before @ref signed-off.
@param gc The connection on which the error has occurred
@param err The error that occurred
@param desc A description of the error, giving more information.
@endsignaldef
*/
// vim: syntax=c.doxygen tw=75 et