about summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2011-03-22 11:09:52 +0000
committerokan <okan>2011-03-22 11:09:52 +0000
commite28a7f832e0cfa4e69a6018027f8c8cc27ca8eac (patch)
tree4b9676f7a729a52ea8d2d48b7c74874cd3213320
parent9c587d972584743333a17b54d4062692fc779a88 (diff)
downloadcwm-e28a7f832e0cfa4e69a6018027f8c8cc27ca8eac.tar.gz
cwm-e28a7f832e0cfa4e69a6018027f8c8cc27ca8eac.tar.xz
cwm-e28a7f832e0cfa4e69a6018027f8c8cc27ca8eac.zip
we should re-focus the client and ungrab the ptr even if we don't have a
mouse based match (i.e. in the kbd no match case).  update the comment
as well.

ok oga@
-rw-r--r--menu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/menu.c b/menu.c
index acdac85..1771cc0 100644
--- a/menu.c
+++ b/menu.c
@@ -171,13 +171,14 @@ menu_filter(struct screen_ctx *sc, struct menu_q *menuq, char *prompt,
 		}
 	}
 out:
-	if (dummy == 0 && mi->dummy) { /* no match */
-		xfree (mi);
+	if (dummy == 0 && mi->dummy) { /* no mouse based match */
+		xfree(mi);
 		mi = NULL;
-		xu_ptr_ungrab();
-		XSetInputFocus(X_Dpy, focuswin, focusrevert, CurrentTime);
 	}
 
+	XSetInputFocus(X_Dpy, focuswin, focusrevert, CurrentTime);
+	xu_ptr_ungrab();
+
 	XUnmapWindow(X_Dpy, sc->menuwin);
 	XUngrabKeyboard(X_Dpy, CurrentTime);
 
@@ -390,7 +391,6 @@ menu_handle_release(XEvent *e, struct menu_ctx *mc, struct screen_ctx *sc,
 	int		 entry, i = 0;
 
 	entry = menu_calc_entry(sc, mc, e->xbutton.x, e->xbutton.y);
-	xu_ptr_ungrab();
 
 	if (mc->hasprompt)
 		i = 1;