Don't assume that priv->current_page is non-NULL. (#347048, Guillaume

2006-07-10  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
	that priv->current_page is non-NULL.  (#347048, Guillaume
	Cottenceau)
This commit is contained in:
Matthias Clasen 2006-07-10 16:19:24 +00:00 committed by Matthias Clasen
parent 2793b42878
commit 310d4367f2
3 changed files with 14 additions and 3 deletions

View File

@ -1,5 +1,9 @@
2006-07-10 Matthias Clasen <mclasen@redhat.com> 2006-07-10 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
that priv->current_page is non-NULL. (#347048, Guillaume
Cottenceau)
* gtk/gtk.symbols: Add some missing deprecation guards. * gtk/gtk.symbols: Add some missing deprecation guards.
* gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc. * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc.

View File

@ -1,5 +1,9 @@
2006-07-10 Matthias Clasen <mclasen@redhat.com> 2006-07-10 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkassistant.c (gtk_assistant_focus): Don't assume
that priv->current_page is non-NULL. (#347048, Guillaume
Cottenceau)
* gtk/gtk.symbols: Add some missing deprecation guards. * gtk/gtk.symbols: Add some missing deprecation guards.
* gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc. * gdk/directfb/gdkwindow-directfb.c: Don't confuse gtk-doc.

View File

@ -1325,7 +1325,8 @@ gtk_assistant_focus (GtkWidget *widget,
if (container->focus_child == priv->action_area) if (container->focus_child == priv->action_area)
{ {
if (!gtk_widget_child_focus (priv->action_area, direction) && if (!gtk_widget_child_focus (priv->action_area, direction) &&
!gtk_widget_child_focus (priv->current_page->page, direction)) (priv->current_page == NULL ||
!gtk_widget_child_focus (priv->current_page->page, direction)))
{ {
/* if we're leaving the action area and the current page hasn't /* if we're leaving the action area and the current page hasn't
any focusable widget, clear focus and go back to the action area */ any focusable widget, clear focus and go back to the action area */
@ -1335,13 +1336,15 @@ gtk_assistant_focus (GtkWidget *widget,
} }
else else
{ {
if (!gtk_widget_child_focus (priv->current_page->page, direction) && if ((priv->current_page == NULL ||
!gtk_widget_child_focus (priv->current_page->page, direction)) &&
!gtk_widget_child_focus (priv->action_area, direction)) !gtk_widget_child_focus (priv->action_area, direction))
{ {
/* if we're leaving the current page and there isn't nothing focusable /* if we're leaving the current page and there isn't nothing focusable
in the action area, try to clear focus and go back to the page */ in the action area, try to clear focus and go back to the page */
gtk_window_set_focus (GTK_WINDOW (widget), NULL); gtk_window_set_focus (GTK_WINDOW (widget), NULL);
gtk_widget_child_focus (priv->current_page->page, direction); if (priv->current_page != NULL)
gtk_widget_child_focus (priv->current_page->page, direction);
} }
} }