changeset 18455:c34981ad802a

Some extra checks to avoid weird crashes.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 10 Jul 2007 08:54:18 +0000
parents 6b623a59cec6
children 58aeac6930fa
files finch/libgnt/gntwm.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntwm.c	Sat Jul 07 10:54:38 2007 +0000
+++ b/finch/libgnt/gntwm.c	Tue Jul 10 08:54:18 2007 +0000
@@ -1918,8 +1918,11 @@
 
 	while (widget->parent)
 		widget = widget->parent;
-	if (!GNT_IS_MENU(widget))
+	if (!GNT_IS_MENU(widget)) {
+		if (!GNT_IS_BOX(widget))
+			return;
 		gnt_box_sync_children(GNT_BOX(widget));
+	}
 
 	ws = gnt_wm_widget_find_workspace(wm, widget);
 	node = g_hash_table_lookup(wm->nodes, widget);
@@ -1932,7 +1935,7 @@
 		gnt_wm_copy_win(widget, node);
 		update_screen(wm);
 		gnt_ws_draw_taskbar(wm->cws, FALSE);
-	} else if (ws != wm->cws && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_URGENT)) {
+	} else if (ws && ws != wm->cws && GNT_WIDGET_IS_FLAG_SET(widget, GNT_WIDGET_URGENT)) {
 		if (!act || (act && !g_list_find(act, ws)))
 			act = g_list_prepend(act, ws);
 		update_act_msg();