summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJun Wu <[email protected]>2014-06-27 13:42:45 +0800
committerinfirit <[email protected]>2014-06-27 11:52:52 +0200
commit407fbdaff20d140fef51c813d8388897040630c0 (patch)
treee0dec4b0e5dd67fd8f9986b39bc65b0ddfed0031
parent351c4c76932abbbf6e235f51fc224c2499c5b3dd (diff)
downloadmate-notification-daemon-407fbdaff20d140fef51c813d8388897040630c0.tar.bz2
mate-notification-daemon-407fbdaff20d140fef51c813d8388897040630c0.tar.xz
Fix assertion WNCK_IS_WORKSPACE
Some window manager such as i3-wm may cause wnck_screen_get_active_workspace to return NULL. Add a sanity check before using the return value.
-rw-r--r--src/daemon/daemon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/daemon/daemon.c b/src/daemon/daemon.c
index c1c7018..49368f2 100644
--- a/src/daemon/daemon.c
+++ b/src/daemon/daemon.c
@@ -1162,6 +1162,11 @@ static gboolean fullscreen_window_exists(GtkWidget* nw)
wnck_workspace = wnck_screen_get_active_workspace (wnck_screen);
+ if (!wnck_workspace)
+ {
+ return FALSE;
+ }
+
for (l = wnck_screen_get_windows_stacked (wnck_screen); l != NULL; l = l->next)
{
WnckWindow *wnck_win = (WnckWindow *) l->data;