#include <X11/cursorfont.h>
#include <X11/cursorfont.h>
#include <X11/Xmu/WinUtil.h>
+#include <X11/XKBlib.h>
#include <stdlib.h>
#include <stdio.h>
if (e->window != e->root) return;
- sw= XmuClientWindow(display, e->subwindow);
- if (!sw) {
+ if (!e->subwindow) {
if (!rightbutton) {
stopselecting();
} else {
return;
}
+ sw= XmuClientWindow(display, e->subwindow);
+
if (sw == w) { beep(); return; }
for (ownp=&headwn;
(unsigned long)e->time,
e->x,e->y, e->x_root,e->y_root,
e->state, e->keycode, (int)e->same_screen);
- if (XKeycodeToKeysym(display, e->keycode, 0) == XK_q) _exit(1);
+ if (XkbKeycodeToKeysym(display, e->keycode, 0, 0) == XK_q) _exit(1);
beep(); return;
}
for (own=headwn; own; own=own->next) {
Font font;
display= XOpenDisplay(0);
+ if (!display) { fputs("XOpenDisplay failed\n",stderr); exit(-1); }
screen= DefaultScreen(display);
cmap= DefaultColormap(display,screen);
root= DefaultRootWindow(display);