From 6d86f63cea38cf554181e810230e15aefa90a604 Mon Sep 17 00:00:00 2001 From: Marijn van Vliet Date: Wed, 5 May 2010 13:47:14 +0000 Subject: [PATCH] Fixed segfault when requesting non-existant parent window git-svn-id: http://lassie.dyndns-server.com/svn/gargoyle-gtk@269 ddfedd41-794f-dd11-ae45-00112f111e67 --- libchimara/window.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libchimara/window.c b/libchimara/window.c index 011b5fb..56cbd70 100644 --- a/libchimara/window.c +++ b/libchimara/window.c @@ -170,7 +170,11 @@ winid_t glk_window_get_parent(winid_t win) { VALID_WINDOW(win, return NULL); + /* Value will also be NULL if win is the root window */ + if(win->window_node->parent == NULL) + return NULL; + return (winid_t)win->window_node->parent->data; } -- 2.30.2