[anjal] Fixes crash while focussing.
- From: Srinivasa Ragavan <sragavan src gnome org>
- To: svn-commits-list gnome org
- Subject: [anjal] Fixes crash while focussing.
- Date: Mon, 18 May 2009 14:55:26 -0400 (EDT)
commit fa0158f7bdc3d0d6cd1a442ae55c30f30d306261
Author: Srinivasa Ragavan <sragavan novell com>
Date: Tue May 19 00:29:41 2009 +0530
Fixes crash while focussing.
---
src/mail-conv-view.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/mail-conv-view.c b/src/mail-conv-view.c
index 3b38736..0f067ec 100644
--- a/src/mail-conv-view.c
+++ b/src/mail-conv-view.c
@@ -209,7 +209,8 @@ mcv_adjust_scroll(MailConvView *mcv, MailMessageView *mmv)
{
int x, y, height, ret;
GtkAdjustment *adj = gtk_viewport_get_vadjustment(mcv->priv->viewport);
-
+ if (!((GtkContainer *)mcv->child_box)->focus_child)
+ return;
ret = gtk_widget_translate_coordinates (mcv->priv->selected_child->data, mcv->child_box, 0, 0, &x, &y);
height = ((GtkContainer *)mcv->child_box)->focus_child->allocation.height;
gtk_adjustment_clamp_page (adj, y + height, y+height+gtk_adjustment_get_page_increment(adj)-36);
@@ -231,6 +232,8 @@ mcv_sh_focus_expose (GtkWidget *w, GdkEventExpose *event, MailConvView *mcv)
if (!mcv->priv->once) {
mcv->priv->once = TRUE;
ret = gtk_widget_translate_coordinates (mcv->priv->selected_child->data, mcv->child_box, 0, 0, &x, &y);
+ if (!((GtkContainer *)mcv->child_box)->focus_child)
+ return FALSE;
height = ((GtkContainer *)mcv->child_box)->focus_child->allocation.height;
gtk_adjustment_clamp_page (adj, y, y+height);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]