[wiki] [sites] Add updated maximize patch for 3465bed290ab || Jonathen Russell

From: <git_AT_suckless.org>
Date: Wed, 30 Dec 2015 21:06:20 +0100

commit c9b330890a17765f2b8f695d0a64ddf4a6b0f5a4
Author: Jonathen Russell <jgr006_AT_gmail.com>
Date: Thu Dec 31 06:01:50 2015 +1000

    Add updated maximize patch for 3465bed290ab
    
        - changes boolean values to integers
    
        - removes redundant window size saving (resizeclient() does
          this already)

diff --git a/dwm.suckless.org/patches/dwm-3465bed290ab-maximize_vert_horz.diff b/dwm.suckless.org/patches/dwm-3465bed290ab-maximize_vert_horz.diff
new file mode 100644
index 0000000..d428708
--- /dev/null
+++ b/dwm.suckless.org/patches/dwm-3465bed290ab-maximize_vert_horz.diff
_AT_@ -0,0 +1,73 @@
+Author: Jan Christoph Ebersbach <jceb_AT_e-jc.de>
+URL: http://dwm.suckless.org/patches/historical/moveresize
+These patches provide helper functions for moving and resizing floating windows
+using keybindings.
+
+Index: dwm/dwm.c
+===================================================================
+--- dwm/dwm.c.orig 2014-02-09 15:24:12.552116979 +0100
++++ dwm/dwm.c 2014-02-09 15:24:12.548116979 +0100
+_AT_@ -92,7 +92,7 @@
+ int basew, baseh, incw, inch, maxw, maxh, minw, minh;
+ int bw, oldbw;
+ unsigned int tags;
+- int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
++ int ismax, wasfloating, isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
+ Client *next;
+ Client *snext;
+ Monitor *mon;
+_AT_@ -1077,6 +1077,8 @@
+ updatewmhints(c);
+ XSelectInput(dpy, w, EnterWindowMask|FocusChangeMask|PropertyChangeMask|StructureNotifyMask);
+ grabbuttons(c, 0);
++ c->wasfloating = 0;
++ c->ismax = 0;
+ if (!c->isfloating)
+ c->isfloating = c->oldstate = trans != None || c->isfixed;
+ if (c->isfloating)
+Index: dwm/maximize.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ dwm/maximize.c 2014-02-09 15:24:12.548116979 +0100
+_AT_@ -0,0 +1,41 @@
++void
++maximize(int x, int y, int w, int h) {
++ XEvent ev;
++
++ if(!selmon->sel || selmon->sel->isfixed)
++ return;
++ XRaiseWindow(dpy, selmon->sel->win);
++ if(!selmon->sel->ismax) {
++ if(!selmon->lt[selmon->sellt]->arrange || selmon->sel->isfloating)
++ selmon->sel->wasfloating = 1;
++ else {
++ togglefloating(NULL);
++ selmon->sel->wasfloating = 0;
++ }
++ resize(selmon->sel, x, y, w, h, 1);
++ selmon->sel->ismax = 1;
++ }
++ else {
++ resize(selmon->sel, selmon->sel->oldx, selmon->sel->oldy, selmon->sel->oldw, selmon->sel->oldh, 1);
++ if(!selmon->sel->wasfloating)
++ togglefloating(NULL);
++ selmon->sel->ismax = 0;
++ }
++ drawbar(selmon);
++ while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
++}
++
++void
++togglemaximize(const Arg *arg) {
++ maximize(selmon->wx, selmon->wy, selmon->ww - 2 * borderpx, selmon->wh - 2 * borderpx);
++}
++
++void
++toggleverticalmax(const Arg *arg) {
++ maximize(selmon->sel->x, selmon->wy, selmon->sel->w, selmon->wh - 2 * borderpx);
++}
++
++void
++togglehorizontalmax(const Arg *arg) {
++ maximize(selmon->wx, selmon->sel->y, selmon->ww - 2 * borderpx, selmon->sel->h);
++}
Received on Wed Dec 30 2015 - 21:06:20 CET

This archive was generated by hypermail 2.3.0 : Wed Dec 30 2015 - 21:12:13 CET