[hackers] [dwm] applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Tue Sep 18 19:09:29 2007

changeset: 1002:5cc2be8efeb4
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Tue Sep 18 19:04:50 2007 +0200
summary: applied Peter Hartlich's togglemax patch to allow toggling tiled clients to maximum

diff -r 2477f818215c -r 5cc2be8efeb4 dwm.1
--- a/dwm.1 Mon Sep 17 16:42:37 2007 +0200
+++ b/dwm.1 Tue Sep 18 19:04:50 2007 +0200
@@ -75,7 +75,7 @@ Increases the master area width about 5%
 Increases the master area width about 5% (tiled layout only).
 .TP
 .B Mod1\-m
-Toggles maximization of current window (floating layout only).
+Toggles maximization of current window.
 .TP
 .B Mod1\-Shift\-[1..n]
 Apply
diff -r 2477f818215c -r 5cc2be8efeb4 dwm.c
--- a/dwm.c Mon Sep 17 16:42:37 2007 +0200
+++ b/dwm.c Tue Sep 18 19:04:50 2007 +0200
@@ -64,7 +64,7 @@ struct Client {
         int minax, maxax, minay, maxay;
         long flags;
         unsigned int border, oldborder;
- Bool isbanned, isfixed, ismax, isfloating;
+ Bool isbanned, isfixed, ismax, isfloating, wasfloating;
         Bool *tags;
         Client *next;
         Client *prev;
@@ -1627,17 +1627,26 @@ togglemax(const char *arg) {
 togglemax(const char *arg) {
         XEvent ev;
 
- if(!sel || (!isarrange(floating) && !sel->isfloating) || sel->isfixed)
+ if(!sel || sel->isfixed)
                 return;
         if((sel->ismax = !sel->ismax)) {
+ if(isarrange(floating) || sel->isfloating)
+ sel->wasfloating = True;
+ else {
+ togglefloating(NULL);
+ sel->wasfloating = False;
+ }
                 sel->rx = sel->x;
                 sel->ry = sel->y;
                 sel->rw = sel->w;
                 sel->rh = sel->h;
                 resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, True);
         }
- else
+ else {
                 resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
+ if (!sel->wasfloating)
+ togglefloating(NULL);
+ }
         drawbar();
         while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
 }
Received on Tue Sep 18 2007 - 19:09:29 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:11 UTC