Hack to make shift-alt-tab (actually anyothermodifiers-key)

cycle backwards though window list (ticket 271).


SVN revision: 40094
This commit is contained in:
Kim Woelders 2009-04-15 19:39:34 +00:00
parent f1852e27b0
commit e438f8898c
3 changed files with 14 additions and 2 deletions

View File

@ -341,6 +341,7 @@ typedef struct {
Window last_bpress2;
unsigned int last_button;
unsigned int last_keycode;
unsigned int last_keystate;
char double_click;
char on_screen;
#if USE_COMPOSITE

View File

@ -305,6 +305,7 @@ HandleEvent(XEvent * ev)
{
case KeyPress:
Mode.events.last_keycode = ev->xkey.keycode;
Mode.events.last_keystate = ev->xkey.state;
case KeyRelease:
Mode.events.time = ev->xkey.time;
ModeGetXY(ev->xbutton.root, ev->xkey.x_root, ev->xkey.y_root);

View File

@ -64,6 +64,7 @@ static WarpFocusWin *warpFocusWindow = NULL;
static int warpFocusIndex = 0;
static unsigned int warpFocusKey = 0;
static unsigned int warpFocusState = 0;
static int warplist_num = 0;
static WarplistItem *warplist;
@ -297,7 +298,10 @@ WarpFocus(int delta)
/* Remember invoking keycode (ugly hack) */
if (!fw || !EoIsShown(fw))
warpFocusKey = Mode.events.last_keycode;
{
warpFocusKey = Mode.events.last_keycode;
warpFocusState = Mode.events.last_keystate;
}
if (!warplist)
{
@ -414,7 +418,12 @@ WarpFocusHandleEvent(Win win __UNUSED__, XEvent * ev, void *prm __UNUSED__)
{
case KeyPress:
if (ev->xkey.keycode == warpFocusKey)
key = 0x80000000;
{
if ((ev->xkey.state & Mode.masks.mod_key_mask) == warpFocusState)
key = 0x80000000;
else
key = 0x80000001;
}
else
key = XLookupKeysym(&ev->xkey, 0);
switch (key)
@ -426,6 +435,7 @@ WarpFocusHandleEvent(Win win __UNUSED__, XEvent * ev, void *prm __UNUSED__)
WarpFocus(1);
break;
case XK_Up:
case 0x80000001:
WarpFocus(-1);
break;
}