mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Use the XGrabKeyboard hack in for alt-tabbing as well. This stops the
mru getting the order messed up when gvim/xpdf et all steal key events. While i'm here, change the logic in client_cyclenext() to use break instead of goto, it's nicer that way. Thirdly, instead of two different kbfuncs, just use the one and a flag. "put your cycle diff in so I can pkg_delete gvim" okan@
This commit is contained in:
parent
7957a470fd
commit
43d6e147c2
3
calmwm.h
3
calmwm.h
@ -221,6 +221,9 @@ TAILQ_HEAD(winmatch_q, winmatch);
|
|||||||
/* for cwm_exec */
|
/* for cwm_exec */
|
||||||
#define CWM_EXEC_PROGRAM 0x1
|
#define CWM_EXEC_PROGRAM 0x1
|
||||||
#define CWM_EXEC_WM 0x2
|
#define CWM_EXEC_WM 0x2
|
||||||
|
/* For alt-tab */
|
||||||
|
#define CWM_CYCLE 0x0
|
||||||
|
#define CWM_RCYCLE 0x1
|
||||||
|
|
||||||
#define KBFLAG_NEEDCLIENT 0x01
|
#define KBFLAG_NEEDCLIENT 0x01
|
||||||
|
|
||||||
|
4
client.c
4
client.c
@ -620,10 +620,10 @@ client_cyclenext(int reverse)
|
|||||||
if (again)
|
if (again)
|
||||||
return (NULL); /* No windows visible. */
|
return (NULL); /* No windows visible. */
|
||||||
|
|
||||||
goto done;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
done:
|
|
||||||
/* reset when alt is released. XXX I hate this hack */
|
/* reset when alt is released. XXX I hate this hack */
|
||||||
sc->altpersist = 1;
|
sc->altpersist = 1;
|
||||||
client_ptrsave(oldcc);
|
client_ptrsave(oldcc);
|
||||||
|
4
conf.c
4
conf.c
@ -209,8 +209,8 @@ struct {
|
|||||||
{ "search", kbfunc_client_search, 0, 0 },
|
{ "search", kbfunc_client_search, 0, 0 },
|
||||||
{ "menusearch", kbfunc_menu_search, 0, 0 },
|
{ "menusearch", kbfunc_menu_search, 0, 0 },
|
||||||
{ "hide", kbfunc_client_hide, KBFLAG_NEEDCLIENT, 0 },
|
{ "hide", kbfunc_client_hide, KBFLAG_NEEDCLIENT, 0 },
|
||||||
{ "cycle", kbfunc_client_cycle, 0, 0 },
|
{ "cycle", kbfunc_client_cycle, 0, (void *)CWM_CYCLE },
|
||||||
{ "rcycle", kbfunc_client_rcycle, 0, 0 },
|
{ "rcycle", kbfunc_client_cycle, 0, (void *)CWM_RCYCLE },
|
||||||
{ "label", kbfunc_client_label, KBFLAG_NEEDCLIENT, 0 },
|
{ "label", kbfunc_client_label, KBFLAG_NEEDCLIENT, 0 },
|
||||||
{ "delete", kbfunc_client_delete, KBFLAG_NEEDCLIENT, 0 },
|
{ "delete", kbfunc_client_delete, KBFLAG_NEEDCLIENT, 0 },
|
||||||
{ "group1", kbfunc_client_group, 0, (void *)1 },
|
{ "group1", kbfunc_client_group, 0, (void *)1 },
|
||||||
|
12
kbfunc.c
12
kbfunc.c
@ -176,13 +176,13 @@ kbfunc_menu_search(struct client_ctx *scratch, void *arg)
|
|||||||
void
|
void
|
||||||
kbfunc_client_cycle(struct client_ctx *scratch, void *arg)
|
kbfunc_client_cycle(struct client_ctx *scratch, void *arg)
|
||||||
{
|
{
|
||||||
client_cyclenext(0);
|
struct screen_ctx *sc = screen_current();
|
||||||
}
|
|
||||||
|
|
||||||
void
|
/* XXX for X apps that ignore events */
|
||||||
kbfunc_client_rcycle(struct client_ctx *scratch, void *arg)
|
XGrabKeyboard(X_Dpy, sc->rootwin, True,
|
||||||
{
|
GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||||
client_cyclenext(1);
|
|
||||||
|
client_cyclenext((int)arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user