[hackers] [dwm][PATCH]

From: Error_404 <ettorenigma_AT_gmail.com>
Date: Mon, 28 Sep 2020 10:11:04 +0200

ix the warning and use a not deprecated function


void keypress(XEvent *e)
{
   unsigned int i;
+ int keysyms_return;
- KeySym keysym;
+ KeySym* keysym;
   XKeyEvent *ev; ev = &e->xkey;
- keysym = XKeycodeToKeysym(dpy, (KeyCode)ev->keycode, 0);
+ keysym = XGetKeyboardMapping(dpy, (KeyCode)ev->keycode, 1,
&keysyms_return);
   for (i = 0; i < LENGTH(keys); i++)
- if (keysym == keys[i].keysym
+ if (*keysym == keys[i].keysym
     && CLEANMASK(keys[i].mod) == CLEANMASK(ev->state)
     && keys[i].func)
        keys[i].func(&(keys[i].arg));
+ XFree(keysym);
}
Received on Mon Sep 28 2020 - 10:11:04 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 28 2020 - 10:12:35 CEST