SHA256
1
0
forked from pool/pidgin

Accepting request 964242 from home:mwilck:branches:network:pidgin

- Fix the infinite resizing freeze
  (boo#1197418, https://issues.imfreedom.org/issue/PIDGIN-17602)
  * added rb1342.patch (https://reviews.imfreedom.org/r/1342/)

OBS-URL: https://build.opensuse.org/request/show/964242
OBS-URL: https://build.opensuse.org/package/show/network:pidgin/pidgin?expand=0&rev=56
This commit is contained in:
Alexei Sorokin 2022-03-23 12:18:54 +00:00 committed by Git OBS Bridge
parent b5921d2c25
commit d8d59d9808
3 changed files with 97 additions and 1 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 23 10:21:56 UTC 2022 - Martin Wilck <mwilck@suse.com>
- Fix the infinite resizing freeze
(boo#1197418, https://issues.imfreedom.org/issue/PIDGIN-17602)
* added rb1342.patch (https://reviews.imfreedom.org/r/1342/)
-------------------------------------------------------------------
Sat Nov 13 12:30:21 UTC 2021 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -1,7 +1,7 @@
#
# spec file for package pidgin
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -38,6 +38,8 @@ Patch2: pidgin-fix-perl-build.patch
Patch3: pidgin-use-default-alsa.patch
# PATCH-FIX-OPENSUSE pidgin-always-enable-intltool.patch mgorse@suse.com -- always enable intltool, needed for autoconf 2.71.
Patch4: pidgin-always-enable-intltool.patch
# https://reviews.imfreedom.org/r/1342/
Patch5: rb1342.patch
BuildRequires: ca-certificates-mozilla
BuildRequires: doxygen
BuildRequires: fdupes
@ -233,6 +235,7 @@ scripts and plugins.
%patch3 -p1
%endif
%patch4 -p1
%patch5 -p1
cp -f %{SOURCE3} %{name}-prefs.xml

86
rb1342.patch Normal file
View File

@ -0,0 +1,86 @@
# HG changeset patch
# Node ID 8719e6ca6ff4
# Parent 17237faf35cb
diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -2361,6 +2361,9 @@
g_return_if_fail(gtkconv != NULL);
+ g_object_set_data(G_OBJECT(gtkconv->imhtml), "resize-count",
+ GINT_TO_POINTER(0));
+
if (!purple_prefs_get_bool("/purple/conversations/im/send_typing"))
return;
@@ -2378,6 +2381,9 @@
g_return_if_fail(gtkconv != NULL);
+ g_object_set_data(G_OBJECT(gtkconv->imhtml), "resize-count",
+ GINT_TO_POINTER(0));
+
conv = gtkconv->active_conv;
if (!purple_prefs_get_bool("/purple/conversations/im/send_typing"))
@@ -5056,6 +5062,7 @@
gtk_widget_set_name(gtkconv->entry, "pidgin_conv_entry");
gtk_imhtml_set_protocol_name(GTK_IMHTML(gtkconv->entry),
purple_account_get_protocol_name(conv->account));
+ g_object_set_data(G_OBJECT(gtkconv->entry), "gtkconv", gtkconv);
g_signal_connect(G_OBJECT(gtkconv->entry), "populate-popup",
G_CALLBACK(entry_popup_menu_cb), gtkconv);
diff --git a/pidgin/gtkimhtml.c b/pidgin/gtkimhtml.c
--- a/pidgin/gtkimhtml.c
+++ b/pidgin/gtkimhtml.c
@@ -387,6 +387,8 @@
static void (*parent_size_allocate)(GtkWidget *widget, GtkAllocation *alloc);
+#define MAX_RESIZE_COUNT 3
+
static void gtk_imhtml_size_allocate(GtkWidget *widget, GtkAllocation *alloc)
{
GtkIMHtml *imhtml = GTK_IMHTML(widget);
@@ -395,6 +397,39 @@
int height = 0, y = 0;
GtkTextIter iter;
gboolean scroll = TRUE;
+ PidginConversation *gtkconv;
+ GtkIMHtml *entry, *messages;
+ int resize_count;
+
+ gtkconv = g_object_get_data(G_OBJECT(imhtml), "gtkconv");
+
+ if(gtkconv != NULL) {
+ entry = GTK_IMHTML(gtkconv->entry);
+ messages = GTK_IMHTML(gtkconv->imhtml);
+
+ resize_count = GPOINTER_TO_INT(
+ g_object_get_data(
+ G_OBJECT(imhtml), "resize-count"));
+
+ if(imhtml == entry) {
+ if(resize_count > MAX_RESIZE_COUNT) {
+ return;
+ }
+ } else if(imhtml == messages) {
+ g_object_set_data(G_OBJECT(entry), "resize-count",
+ GINT_TO_POINTER(0));
+
+ if(resize_count > MAX_RESIZE_COUNT){
+ g_object_set_data(G_OBJECT(messages), "resize-count",
+ GINT_TO_POINTER(0));
+ return;
+ }
+ }
+
+ resize_count++;
+ g_object_set_data(G_OBJECT(imhtml), "resize-count",
+ GINT_TO_POINTER(resize_count));
+ }
gtk_text_buffer_get_end_iter(imhtml->text_buffer, &iter);