add togglewarp function

This commit is contained in:
2021-10-02 17:12:03 +02:00
parent 89d2cee6fa
commit 3cf9f6f915
2 changed files with 22 additions and 7 deletions

12
dwm.c
View File

@@ -226,6 +226,7 @@ static void togglefullscr(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void togglesticky(const Arg *arg);
static void togglewarp(const Arg *arg);
static void unfocus(Client *c, int setfocus);
static void unmanage(Client *c, int destroyed);
static void unmapnotify(XEvent *e);
@@ -290,6 +291,7 @@ static Drw *drw;
static Monitor *mons, *selmon;
static Window root, wmcheckwin;
/* configuration, allows nested code to access above variables */
#include "config.h"
@@ -1865,6 +1867,13 @@ togglesticky(const Arg *arg)
arrange(selmon);
}
void togglewarp(const Arg *arg){
if (dowarp)
dowarp=0;
else
dowarp=1;
}
void
setsticky(const Arg *arg)
{
@@ -2230,6 +2239,8 @@ view(const Arg *arg)
void
warp(const Client *c)
{
if (!dowarp)
return;
int x, y;
if (!c) {
@@ -2648,3 +2659,4 @@ void
spiral(Monitor *mon) {
fibonacci(mon, 0);
}