Adding sticky and warp patches
This commit is contained in:
@ -58,6 +58,10 @@
|
||||
#include "setborderpx.c"
|
||||
#endif
|
||||
|
||||
#if STICKY_PATCH
|
||||
#include "sticky.c"
|
||||
#endif
|
||||
|
||||
#if SYSTRAY_PATCH
|
||||
#include "systray.c"
|
||||
#endif
|
||||
@ -78,6 +82,10 @@
|
||||
#include "vanitygaps.c"
|
||||
#endif
|
||||
|
||||
#if WARP_PATCH
|
||||
#include "warp.c"
|
||||
#endif
|
||||
|
||||
#if ZOOMSWAP_PATCH
|
||||
#include "zoomswap.c"
|
||||
#endif
|
||||
|
@ -54,6 +54,10 @@
|
||||
#include "setborderpx.h"
|
||||
#endif
|
||||
|
||||
#if STICKY_PATCH
|
||||
#include "sticky.h"
|
||||
#endif
|
||||
|
||||
#if SYSTRAY_PATCH
|
||||
#include "systray.h"
|
||||
#endif
|
||||
|
@ -34,7 +34,7 @@ pushup(const Arg *arg)
|
||||
if (selmon->clients == c)
|
||||
selmon->clients = sel;
|
||||
else {
|
||||
for (c f selmon->clients; c->next != sel->next; c = c->next);
|
||||
for (c = selmon->clients; c->next != sel->next; c = c->next);
|
||||
c->next = sel;
|
||||
}
|
||||
} else {
|
||||
|
8
patch/sticky.c
Normal file
8
patch/sticky.c
Normal file
@ -0,0 +1,8 @@
|
||||
void
|
||||
togglesticky(const Arg *arg)
|
||||
{
|
||||
if (!selmon->sel)
|
||||
return;
|
||||
selmon->sel->issticky = !selmon->sel->issticky;
|
||||
arrange(selmon);
|
||||
}
|
1
patch/sticky.h
Normal file
1
patch/sticky.h
Normal file
@ -0,0 +1 @@
|
||||
static void togglesticky(const Arg *arg);
|
21
patch/warp.c
Normal file
21
patch/warp.c
Normal file
@ -0,0 +1,21 @@
|
||||
void
|
||||
warp(const Client *c)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (!c) {
|
||||
XWarpPointer(dpy, None, root, 0, 0, 0, 0, selmon->wx + selmon->ww/2, selmon->wy + selmon->wh/2);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!getrootptr(&x, &y) ||
|
||||
(x > c->x - c->bw &&
|
||||
y > c->y - c->bw &&
|
||||
x < c->x + c->w + c->bw*2 &&
|
||||
y < c->y + c->h + c->bw*2) ||
|
||||
(y > c->mon->by && y < c->mon->by + bh) ||
|
||||
(c->mon->topbar && !y))
|
||||
return;
|
||||
|
||||
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w / 2, c->h / 2);
|
||||
}
|
1
patch/warp.h
Normal file
1
patch/warp.h
Normal file
@ -0,0 +1 @@
|
||||
static void warp(const Client *c);
|
Reference in New Issue
Block a user