aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2009-09-24 00:43:43 +0800
committerCosimo Cecchi <cosimoc@gnome.org>2009-09-24 17:38:44 +0800
commit3b1dc603c5f7174904bc1c6c01566700f0bab894 (patch)
tree643aaa371d33a9b289321271c0c32b4d40caea79 /src
parentafc13fa1d9a600647fa806a0b7c40446aca26658 (diff)
downloadgsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar.gz
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar.bz2
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar.lz
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar.xz
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.tar.zst
gsoc2013-empathy-3b1dc603c5f7174904bc1c6c01566700f0bab894.zip
Don't rely on the widget allocation to be != 0.
This should fix bug #595945.
Diffstat (limited to 'src')
-rw-r--r--src/empathy-call-window.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/empathy-call-window.c b/src/empathy-call-window.c
index e7cbadc23..363d29441 100644
--- a/src/empathy-call-window.c
+++ b/src/empathy-call-window.c
@@ -887,8 +887,18 @@ static void
contact_avatar_changed_cb (EmpathyContact *contact,
GParamSpec *pspec, GtkWidget *avatar_widget)
{
- init_contact_avatar_with_size (contact, avatar_widget,
- avatar_widget->allocation.height);
+ int size;
+
+ size = avatar_widget->allocation.height;
+
+ if (size == 0)
+ {
+ /* the widget is not allocated yet, set a default size */
+ size = MIN (REMOTE_CONTACT_AVATAR_DEFAULT_HEIGHT,
+ REMOTE_CONTACT_AVATAR_DEFAULT_WIDTH);
+ }
+
+ init_contact_avatar_with_size (contact, avatar_widget, size);
}
static void