aboutsummaryrefslogtreecommitdiffstats
path: root/xutil.c
diff options
context:
space:
mode:
authorokan2016-09-30 18:28:06 +0000
committerokan2016-09-30 18:28:06 +0000
commit3c9ef4366fd228c7272aa4f467ee4f7ecadf2049 (patch)
tree9156fb5949d06e6243f4fd6a92a55c24aa923090 /xutil.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 'xutil.c')
-rw-r--r--xutil.c64
1 files changed, 1 insertions, 63 deletions
diff --git a/xutil.c b/xutil.c
index 3e7e99e..f2691ff 100644
--- a/xutil.c
+++ b/xutil.c
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $OpenBSD: xutil.c,v 1.105 2016/09/28 17:06:33 okan Exp $
+ * $OpenBSD: xutil.c,v 1.106 2016/09/30 18:28:06 okan Exp $
*/
#include <sys/types.h>
@@ -31,68 +31,6 @@
#include "calmwm.h"
-static unsigned int ign_mods[] = { 0, LockMask, Mod2Mask, Mod2Mask | LockMask };
-
-void
-xu_btn_grab(Window win, int mask, unsigned int btn)
-{
- unsigned int i;
-
- for (i = 0; i < nitems(ign_mods); i++)
- XGrabButton(X_Dpy, btn, (mask | ign_mods[i]), win,
- False, BUTTONMASK, GrabModeAsync,
- GrabModeSync, None, None);
-}
-
-void
-xu_btn_ungrab(Window win)
-{
- XUngrabButton(X_Dpy, AnyButton, AnyModifier, win);
-}
-
-void
-xu_key_grab(Window win, unsigned int mask, KeySym keysym)
-{
- KeyCode code;
- unsigned int i;
-
- code = XKeysymToKeycode(X_Dpy, keysym);
- if ((XkbKeycodeToKeysym(X_Dpy, code, 0, 0) != keysym) &&
- (XkbKeycodeToKeysym(X_Dpy, code, 0, 1) == keysym))
- mask |= ShiftMask;
-
- for (i = 0; i < nitems(ign_mods); i++)
- XGrabKey(X_Dpy, code, (mask | ign_mods[i]), win,
- True, GrabModeAsync, GrabModeAsync);
-}
-
-void
-xu_key_ungrab(Window win)
-{
- XUngrabKey(X_Dpy, AnyKey, AnyModifier, win);
-}
-
-int
-xu_ptr_grab(Window win, unsigned int mask, Cursor curs)
-{
- return(XGrabPointer(X_Dpy, win, False, mask,
- GrabModeAsync, GrabModeAsync,
- None, curs, CurrentTime) == GrabSuccess ? 0 : -1);
-}
-
-int
-xu_ptr_regrab(unsigned int mask, Cursor curs)
-{
- return(XChangeActivePointerGrab(X_Dpy, mask,
- curs, CurrentTime) == GrabSuccess ? 0 : -1);
-}
-
-void
-xu_ptr_ungrab(void)
-{
- XUngrabPointer(X_Dpy, CurrentTime);
-}
-
void
xu_ptr_getpos(Window win, int *x, int *y)
{