aboutsummaryrefslogtreecommitdiffstats
path: root/mousefunc.c
diff options
context:
space:
mode:
authorokan2016-09-30 18:28:06 +0000
committerokan2016-09-30 18:28:06 +0000
commit3c9ef4366fd228c7272aa4f467ee4f7ecadf2049 (patch)
tree9156fb5949d06e6243f4fd6a92a55c24aa923090 /mousefunc.c
parent6683b9c99889c3bbc28f721777801aef4ba84bf9 (diff)
downloadcwm-3c9ef4366fd228c7272aa4f467ee4f7ecadf2049.tar.gz
Use instinsic X11 functions for key/btn/ptr grab/ungrab/regrab requests;
the one line wrappers provided no value and limited altering calls where needed; additionally, most of them had but one caller.
Diffstat (limited to 'mousefunc.c')
-rw-r--r--mousefunc.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/mousefunc.c b/mousefunc.c
index 0428bf2..24f0e3e 100644
--- a/mousefunc.c
+++ b/mousefunc.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: mousefunc.c,v 1.110 2016/09/30 15:12:19 okan Exp $
+ * $OpenBSD: mousefunc.c,v 1.111 2016/09/30 18:28:06 okan Exp $
*/
#include <sys/types.h>
@@ -45,7 +45,9 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg)
client_raise(cc);
client_ptrsave(cc);
- if (xu_ptr_grab(cc->win, MOUSEMASK, Conf.cursor[CF_RESIZE]) < 0)
+ if (XGrabPointer(X_Dpy, cc->win, False, MOUSEMASK,
+ GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_RESIZE],
+ CurrentTime) != GrabSuccess)
return;
xu_ptr_setpos(cc->win, cc->geom.w, cc->geom.h);
@@ -71,7 +73,7 @@ mousefunc_client_resize(struct client_ctx *cc, union arg *arg)
client_resize(cc, 1);
XUnmapWindow(X_Dpy, sc->menu.win);
XReparentWindow(X_Dpy, sc->menu.win, sc->rootwin, 0, 0);
- xu_ptr_ungrab();
+ XUngrabPointer(X_Dpy, CurrentTime);
/* Make sure the pointer stays within the window. */
if (cc->ptr.x > cc->geom.w)
@@ -99,7 +101,9 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg)
if (cc->flags & CLIENT_FREEZE)
return;
- if (xu_ptr_grab(cc->win, MOUSEMASK, Conf.cursor[CF_MOVE]) < 0)
+ if (XGrabPointer(X_Dpy, cc->win, False, MOUSEMASK,
+ GrabModeAsync, GrabModeAsync, None, Conf.cursor[CF_MOVE],
+ CurrentTime) != GrabSuccess)
return;
xu_ptr_getpos(cc->win, &px, &py);
@@ -134,7 +138,7 @@ mousefunc_client_move(struct client_ctx *cc, union arg *arg)
client_move(cc);
XUnmapWindow(X_Dpy, sc->menu.win);
XReparentWindow(X_Dpy, sc->menu.win, sc->rootwin, 0, 0);
- xu_ptr_ungrab();
+ XUngrabPointer(X_Dpy, CurrentTime);
return;
}
}