Skip to content

Commit

Permalink
workaround for desktop=-1
Browse files Browse the repository at this point in the history
Closes #35.
  • Loading branch information
sagb committed Dec 12, 2017
1 parent a899f0f commit 6fc593e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ewmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ unsigned long ewmh_getCurrentDesktop()
if (!cd)
cd = (unsigned long*)get_x_property (root, XA_CARDINAL,
"_WIN_WORKSPACE", &propsize);
return (cd && (propsize>0)) ? *cd : 1;
return (cd && (propsize>0) && ((signed long)(*cd)>0)) ? *cd : 1;
}

//
Expand All @@ -228,6 +228,6 @@ unsigned long ewmh_getDesktopOfWindow(Window w)
if (!d)
d = (unsigned long*)get_x_property (w, XA_CARDINAL,
"_WIN_WORKSPACE", NULL);
return d ? *d : 1;
return (d && ((signed long)(*d) > 0)) ? *d : 1;
}

0 comments on commit 6fc593e

Please sign in to comment.