summaryrefslogtreecommitdiff
path: root/src/actions.c
diff options
context:
space:
mode:
authorShawn Betts <sabetts@gmail.com>2009-04-13 05:19:46 -0700
committerShawn Betts <sabetts@gmail.com>2009-04-13 05:19:46 -0700
commitbd7aa51699f49cf7a67c403ba7f2ba3738fcf644 (patch)
tree9cdfbed91a22a4bde2570ab3cf80b408bbc8c18d /src/actions.c
parent300c05edf890fbe2de11070b9839359bef9916e1 (diff)
downloadratpoison-bd7aa51699f49cf7a67c403ba7f2ba3738fcf644.zip
fix segfault in banishrel and make it banish to the corner of the frame when there's no window
* update documentation
Diffstat (limited to 'src/actions.c')
-rw-r--r--src/actions.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/actions.c b/src/actions.c
index 7e587b7..3958938 100644
--- a/src/actions.c
+++ b/src/actions.c
@@ -3106,15 +3106,15 @@ cmd_banish (int interactive, struct cmdarg **args)
cmdret *
cmd_banishrel (int interactive, struct cmdarg **args)
{
- rp_screen *s;
- rp_window *w;
+ rp_screen *s = current_screen();
+ rp_window *w = current_window();
+ rp_frame *f = current_frame();
- s = current_screen();
- w = current_window();
- if (!w)
- cmd_banish (interactive, args);
+ if (w)
+ XWarpPointer (dpy, None, w->w, 0, 0, 0, 0, w->x + w->width - 2, w->y + w->height - 2);
+ else
+ XWarpPointer (dpy, None, s->root, 0, 0, 0, 0, f->x + f->width, f->y + f->height);
- XWarpPointer (dpy, None, w->w, 0, 0, 0, 0, w->x + w->width - 2, w->y + w->height - 2);
return cmdret_new (RET_SUCCESS, NULL);
}