diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2009-09-24 00:43:43 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-09-25 00:50:05 +0800 |
commit | 84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d (patch) | |
tree | 648b86c1aebb55d0827254c94ed92dcaa97fef03 | |
parent | 3c8557efe1b3bb97ba359b1d41165611e568f034 (diff) | |
download | gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar.gz gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar.bz2 gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar.lz gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar.xz gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.tar.zst gsoc2013-empathy-84978ae1b087a3a0d13c5c91c83ddcc0bc13ac5d.zip |
Don't rely on the widget allocation to be != 0.
This should fix bug #595945.
-rw-r--r-- | src/empathy-call-window.c | 14 |
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 |