[wiki] [sites] Fixed moveresize patch page || lich

From: <git_AT_suckless.org>
Date: Sat, 14 Apr 2018 12:46:22 +0200

commit 9496b912b4518186118cd0bfe1884d47e2dcb1f5
Author: lich <lich_AT_airmail.cc>
Date: Sat Apr 14 11:45:38 2018 +0100

    Fixed moveresize patch page
    
    Previous page caused dwm to crash when those edits were added, also
    formatting caused the edits to be illegible.

diff --git a/dwm.suckless.org/patches/moveresize/index.md b/dwm.suckless.org/patches/moveresize/index.md
index d789a36a..8c4763a6 100644
--- a/dwm.suckless.org/patches/moveresize/index.md
+++ b/dwm.suckless.org/patches/moveresize/index.md
_AT_@ -11,37 +11,37 @@ Usage
  1. Put the following `moveresize()` function somewhere in your `dwm.c`,
     **after** the line which includes the config.h file:
 
- static void
- moveresize(const Arg *arg)
- {
-
- XEvent ev;
- Monitor *m = selmon;
-
- if(!(m->sel && arg && arg->v && m->sel->isfloating))
- return;
-
- resize(m->sel, m->sel->x + ((int *)arg->v)[0],
- m->sel->y + ((int *)arg->v)[1],
- m->sel->w + ((int *)arg->v)[2],
- m->sel->h + ((int *)arg->v)[3],
- True);
-
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
- }
+ static void
+ moveresize(const Arg *arg)
+ {
+
+ XEvent ev;
+ Monitor *m = selmon;
+
+ if(!(m->sel && arg && arg->v && m->sel->isfloating))
+ return;
+
+ resize(m->sel, m->sel->x + ((int *)arg->v)[0],
+ m->sel->y + ((int *)arg->v)[1],
+ m->sel->w + ((int *)arg->v)[2],
+ m->sel->h + ((int *)arg->v)[3],
+ True);
+
+ while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+ }
 
  2. Insert the bindings into the keys list. Here is an example which uses the
     arrow keys to move (mod+arrow) or resize (mod+shift+arrow) the selected
- client:
+ client:
 
- { MODKEY, XK_Down, moveresize, {.v = "0x 25y 0w 0h"}},
- { MODKEY, XK_Up, moveresize, {.v = "0x -25y 0w 0h"}},
- { MODKEY, XK_Right, moveresize, {.v = "25x 0y 0w 0h"}},
- { MODKEY, XK_Left, moveresize, {.v = "-25x 0y 0w 0h"}},
- { MODKEY|ShiftMask, XK_Down, moveresize, {.v = "0x 0y 0w 25h"}},
- { MODKEY|ShiftMask, XK_Up, moveresize, {.v = "0x 0y 0w -25h"}},
- { MODKEY|ShiftMask, XK_Right, moveresize, {.v = "0x 0y 25w 0h"}},
- { MODKEY|ShiftMask, XK_Left, moveresize, {.v = "0x 0y -25w 0h"}},
+ { MODKEY, XK_Down, moveresize, {.v = (int []){ 0, 25, 0, 0 }}},
+ { MODKEY, XK_Up, moveresize, {.v = (int []){ 0, -25, 0, 0 }}},
+ { MODKEY, XK_Right, moveresize, {.v = (int []){ 25, 0, 0, 0 }}},
+ { MODKEY, XK_Left, moveresize, {.v = (int []){ -25, 0, 0, 0 }}},
+ { MODKEY|ShiftMask, XK_Down, moveresize, {.v = (int []){ 0, 0, 0, 25 }}},
+ { MODKEY|ShiftMask, XK_Up, moveresize, {.v = (int []){ 0, 0, 0, -25 }}},
+ { MODKEY|ShiftMask, XK_Right, moveresize, {.v = (int []){ 0, 0, 25, 0 }}},
+ { MODKEY|ShiftMask, XK_Left, moveresize, {.v = (int []){ 0, 0, -25, 0 }}},
 
 If you want to automatically toggle the client floating when move/resize,
 replace the `if()` statement above with this code:
Received on Sat Apr 14 2018 - 12:46:22 CEST

This archive was generated by hypermail 2.3.0 : Sat Apr 14 2018 - 12:48:22 CEST