2004-01-28 15:58:53 -05:00
|
|
|
$OpenBSD: patch-olvwmrc_y,v 1.1 2004/01/28 20:58:54 naddy Exp $
|
|
|
|
--- olvwmrc.y.orig 1994-01-13 22:46:53.000000000 +0100
|
|
|
|
+++ olvwmrc.y 2004-01-28 21:49:10.000000000 +0100
|
1998-09-29 22:31:44 -04:00
|
|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
1999-07-17 06:53:21 -04:00
|
|
|
%{
|
1998-09-29 22:31:44 -04:00
|
|
|
#ifdef IDENT
|
1999-07-17 06:53:21 -04:00
|
|
|
-#ident "@(#)olvwmrc.y 1.6 olvwm version 07 Jan 1994"
|
|
|
|
+#ident "@(#)olvwmrc.y 1.7 olvwm version 01/13/98"
|
1998-09-29 22:31:44 -04:00
|
|
|
#endif
|
|
|
|
|
1999-07-17 06:53:21 -04:00
|
|
|
#include <sys/types.h>
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -81,6 +81,7 @@ List *ProgKeyList = NULL;
|
1999-07-17 06:53:21 -04:00
|
|
|
List *WinMenuActionsList = NULL;
|
|
|
|
|
|
|
|
static Display *dpy;
|
|
|
|
+static unsigned int NumLockMask;
|
|
|
|
%}
|
|
|
|
|
|
|
|
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -526,7 +527,9 @@ String : WORD
|
1999-07-17 06:53:21 -04:00
|
|
|
}
|
|
|
|
%%
|
|
|
|
/* Programs */
|
|
|
|
+#ifndef YYDEBUG
|
|
|
|
#define YYDEBUG 1
|
1998-09-29 22:31:44 -04:00
|
|
|
+#endif
|
1999-07-17 06:53:21 -04:00
|
|
|
#include "parse.c"
|
|
|
|
|
|
|
|
extern List *ActiveClientList;
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -577,7 +580,7 @@ char name[];
|
1999-07-17 06:53:21 -04:00
|
|
|
return(True);
|
|
|
|
}
|
|
|
|
|
|
|
|
-static char *
|
|
|
|
+extern char *
|
|
|
|
strexpand(s)
|
|
|
|
char *s;
|
|
|
|
{
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -712,7 +715,8 @@ matchProgKey(p, ev)
|
1998-09-29 22:31:44 -04:00
|
|
|
|
1999-07-17 06:53:21 -04:00
|
|
|
{
|
|
|
|
if (p->keycode == ev->xkey.keycode &&
|
|
|
|
- (p->modmask == AnyModifier || p->modmask == ev->xkey.state))
|
|
|
|
+ (p->modmask == AnyModifier ||
|
|
|
|
+ (p->modmask == (~(NumLockMask|LockMask) & ev->xkey.state))))
|
|
|
|
return p;
|
|
|
|
return NULL;
|
|
|
|
}
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -799,14 +803,26 @@ struct stat statbuf;
|
1999-07-17 06:53:21 -04:00
|
|
|
extern List *ScreenInfoList;
|
|
|
|
List *l = ScreenInfoList;
|
|
|
|
ScreenInfo *scr;
|
|
|
|
+ Client *saveClient = NULL;
|
|
|
|
+ Window root, child;
|
|
|
|
+ int rx, ry, wx, wy;
|
|
|
|
+ unsigned int keys;
|
1998-09-29 22:31:44 -04:00
|
|
|
|
1999-07-17 06:53:21 -04:00
|
|
|
/* allow one warp per screen */
|
|
|
|
for (scr = ListEnum(&l); scr != NULL; scr = ListEnum(&l)) {
|
|
|
|
findClient_rootid = scr->rootid;
|
|
|
|
c = (Client *) ListApply(ActiveClientList, findClient, t);
|
|
|
|
- if (c)
|
|
|
|
- clientWarp(c);
|
|
|
|
+ if (c) {
|
|
|
|
+ if (XQueryPointer(dpy, c->groupid, &root, &child,
|
|
|
|
+ &rx, &ry, &wx, &wy, &keys)) {
|
|
|
|
+ clientWarp(c);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ else saveClient = c;
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
+ if (saveClient)
|
|
|
|
+ clientWarp(c);
|
|
|
|
findClient_rootid = 0;
|
|
|
|
}
|
|
|
|
free(s);
|
2004-01-28 15:58:53 -05:00
|
|
|
@@ -1249,6 +1265,7 @@ InitOlvwmRC(ldpy, path)
|
1999-07-17 06:53:21 -04:00
|
|
|
return;
|
|
|
|
olvwmOldBuf = olvwmBuf;
|
|
|
|
dpy = ldpy;
|
|
|
|
+ NumLockMask = FindModifierMask(XKeysymToKeycode(dpy, XK_Num_Lock));
|
|
|
|
yyparse();
|
|
|
|
#ifdef DEBUG
|
|
|
|
DumpProgKeyList();
|