From fb56250d1859ae3f6fd1b3dfa9fee922495ecd19 Mon Sep 17 00:00:00 2001 From: QC Date: Sun, 25 May 2014 11:34:45 +0200 Subject: [PATCH] Fix a newly exposed bug, i3 indicating an active window that does not exists --- source/rofi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/rofi.c b/source/rofi.c index 5d9127f4..1cde37c4 100644 --- a/source/rofi.c +++ b/source/rofi.c @@ -647,8 +647,13 @@ void monitor_active ( workarea *mon ) && type == XA_WINDOW && count > 0 ) { XWindowAttributes *attr = window_get_attributes ( id ); - monitor_dimensions ( screen, attr->x, attr->y, mon ); - return; + // Window might not exists anymore. + // This could very well be a bug in i3. + if ( attr != NULL ) + { + monitor_dimensions ( screen, attr->x, attr->y, mon ); + return; + } } int x, y;