Introduction
Introduction Statistics Contact Development Disclaimer Help
tsimplified Mod-m - dwm - [fork] customized build of dwm, the dynamic window ma…
git clone git://src.adamsgaard.dk/dwm
Log
Files
Refs
README
LICENSE
---
commit 5f19423c7bd2aa1ebb3010af15bebffbc3a9cbc3
parent d66ad1457e6b1e3fc18c01767fdb499acaef3c8e
Author: Anselm R. Garbe <[email protected]>
Date: Sun, 9 Dec 2007 13:39:29 +0100
simplified Mod-m
Diffstat:
M config.def.h | 2 +-
M dwm.1 | 2 +-
M dwm.c | 46 +++++++----------------------…
3 files changed, 12 insertions(+), 38 deletions(-)
---
diff --git a/config.def.h b/config.def.h
t@@ -46,7 +46,7 @@ Key keys[] = {
{ MODKEY, XK_k, focusprev, …
{ MODKEY, XK_h, setmwfact, …
{ MODKEY, XK_l, setmwfact, …
- { MODKEY, XK_m, togglemax, …
+ { MODKEY, XK_m, maximize, …
{ MODKEY, XK_r, reapply, …
{ MODKEY, XK_Return, zoom, …
{ MODKEY, XK_Tab, viewprevtag, …
diff --git a/dwm.1 b/dwm.1
t@@ -78,7 +78,7 @@ Focus previous window.
Increases the master area width about 5% (tiled layout only).
.TP
.B Mod1\-m
-Toggles maximization of current window.
+Maximizes current window (floating layout/window only).
.TP
.B Mod1\-r
Re-applies tagging rules to all windows.
diff --git a/dwm.c b/dwm.c
t@@ -61,12 +61,11 @@ typedef struct Client Client;
struct Client {
char name[256];
int x, y, w, h;
- int rx, ry, rw, rh; /* revert geometry */
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int minax, maxax, minay, maxay;
long flags;
unsigned int border, oldborder;
- Bool isbanned, isfixed, ismax, isfloating, wasfloating;
+ Bool isbanned, isfixed, isfloating;
Bool *tags;
Client *next;
Client *prev;
t@@ -157,6 +156,7 @@ void leavenotify(XEvent *e);
void manage(Window w, XWindowAttributes *wa);
void mappingnotify(XEvent *e);
void maprequest(XEvent *e);
+void maximize(const char *arg);
void movemouse(Client *c);
Client *nexttiled(Client *c);
void propertynotify(XEvent *e);
t@@ -178,7 +178,6 @@ unsigned int textw(const char *text);
void tile(void);
void togglebar(const char *arg);
void togglefloating(const char *arg);
-void togglemax(const char *arg);
void toggletag(const char *arg);
void toggleview(const char *arg);
void unban(Client *c);
t@@ -466,7 +465,6 @@ configurerequest(XEvent *e) {
XWindowChanges wc;
if((c = getclient(ev->window))) {
- c->ismax = False;
if(ev->value_mask & CWBorderWidth)
c->border = ev->border_width;
if(c->isfixed || c->isfloating || (floating == layout->arrange…
t@@ -563,7 +561,7 @@ drawbar(void) {
dc.x = x;
if(sel) {
drawtext(sel->name, dc.sel);
- drawsquare(sel->ismax, sel->isfloating, dc.sel);
+ drawsquare(False, sel->isfloating, dc.sel);
}
else
drawtext(NULL, dc.norm);
t@@ -1079,6 +1077,13 @@ maprequest(XEvent *e) {
}
void
+maximize(const char *arg) {
+ if(!sel || (!sel->isfloating && layout->arrange != floating))
+ return;
+ resize(sel, wax, way, waw - 2 * sel->border, wah - 2 * sel->border, Tr…
+}
+
+void
movemouse(Client *c) {
int x1, y1, ocx, ocy, di, nx, ny;
unsigned int dui;
t@@ -1090,7 +1095,6 @@ movemouse(Client *c) {
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAs…
None, cursor[CurMove], CurrentTime) != GrabSuccess)
return;
- c->ismax = False;
XQueryPointer(dpy, root, &dummy, &dummy, &x1, &y1, &di, &di, &dui);
for(;;) {
XMaskEvent(dpy, MOUSEMASK | ExposureMask | SubstructureRedirec…
t@@ -1248,7 +1252,6 @@ resizemouse(Client *c) {
if(XGrabPointer(dpy, root, False, MOUSEMASK, GrabModeAsync, GrabModeAs…
None, cursor[CurResize], CurrentTime) != GrabSuccess)
return;
- c->ismax = False;
XWarpPointer(dpy, None, c->win, 0, 0, 0, 0, c->w + c->border - 1, c->h…
for(;;) {
XMaskEvent(dpy, MOUSEMASK | ExposureMask | SubstructureRedirec…
t@@ -1609,7 +1612,6 @@ tile(void) {
ny = way;
nw = 0; /* gcc stupidity requires this */
for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c->next), i++…
- c->ismax = False;
if(i == 0) { /* master */
nw = mw - 2 * c->border;
nh = wah - 2 * c->border;
t@@ -1655,34 +1657,6 @@ togglefloating(const char *arg) {
}
void
-togglemax(const char *arg) {
- XEvent ev;
-
- if(!sel || sel->isfixed)
- return;
- if((sel->ismax = !sel->ismax)) {
- if((layout->arrange == 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->bo…
- }
- else {
- resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
- if(!sel->wasfloating)
- togglefloating(NULL);
- }
- drawbar();
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
-}
-
-void
toggletag(const char *arg) {
unsigned int i, j;
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.