summaryrefslogtreecommitdiff
path: root/dmenu.c
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2022-01-26 23:58:58 -0600
committerzachir <zachir@librem.one>2022-01-26 23:58:58 -0600
commit1fb05957ed1454c6aa97d862f3cafc5721d7e473 (patch)
tree664a94f5c4f7b96022e86071d9d1d698905eccd1 /dmenu.c
parent1bed7cd1f6fcba4b701317bd589f13639ba6283e (diff)
dmenu.c: fix warning about INTERSECT with bool vs int
Diffstat (limited to 'dmenu.c')
-rw-r--r--dmenu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/dmenu.c b/dmenu.c
index 3240aee..0f4d6b4 100644
--- a/dmenu.c
+++ b/dmenu.c
@@ -23,6 +23,8 @@
/* macros */
#define INTERSECT(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
* MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
+#define INTERSECTBOOL(x,y,w,h,r) (MAX(0, MIN((x)+(w),(r).x_org+(r).width) - MAX((x),(r).x_org)) \
+ && MAX(0, MIN((y)+(h),(r).y_org+(r).height) - MAX((y),(r).y_org)))
#define LENGTH(X) (sizeof X / sizeof X[0])
#define TEXTW(X) (drw_fontset_getwidth(drw, (X)) + lrpad)
@@ -1052,7 +1054,7 @@ setup(void)
/* no focused window is on screen, so use pointer location instead */
if (mon < 0 && !area && XQueryPointer(dpy, root, &dw, &dw, &x, &y, &di, &di, &du))
for (i = 0; i < n; i++)
- if (INTERSECT(x, y, 1, 1, info[i]))
+ if (INTERSECTBOOL(x, y, 1, 1, info[i]))
break;
if (centered) {