[hackers] [dwm] moved floating to layout.c, kept tile.c outside

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Sun Aug 12 13:13:42 2007

changeset: 944:bd5cf635c601
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Sun Aug 12 13:10:21 2007 +0200
summary: moved floating to layout.c, kept tile.c outside

diff -r d0b93818f723 -r bd5cf635c601 config.arg.h
--- a/config.arg.h Sun Aug 12 12:46:08 2007 +0200
+++ b/config.arg.h Sun Aug 12 13:10:21 2007 +0200
@@ -25,7 +25,6 @@ static Rule rule[] = { \
 
 /* layout(s) */
 #include "tile.h"
-#include "float.h"
 #define LAYOUTS \
 static Layout layout[] = { \
         /* symbol function */ \
diff -r d0b93818f723 -r bd5cf635c601 config.default.h
--- a/config.default.h Sun Aug 12 12:46:08 2007 +0200
+++ b/config.default.h Sun Aug 12 13:10:21 2007 +0200
@@ -26,7 +26,6 @@ static Rule rule[] = { \
 
 /* layout(s) */
 #include "tile.h"
-#include "float.h"
 #define LAYOUTS \
 static Layout layout[] = { \
         /* symbol function */ \
diff -r d0b93818f723 -r bd5cf635c601 config.mk
--- a/config.mk Sun Aug 12 12:46:08 2007 +0200
+++ b/config.mk Sun Aug 12 13:10:21 2007 +0200
@@ -3,8 +3,8 @@ VERSION = 4.4
 
 # Customize below to fit your system
 
-# layouts
-SRC = float.c tile.c
+# additional layouts beside floating
+SRC = tile.c
 
 # paths
 PREFIX = /usr/local
diff -r d0b93818f723 -r bd5cf635c601 dwm.h
--- a/dwm.h Sun Aug 12 12:46:08 2007 +0200
+++ b/dwm.h Sun Aug 12 13:10:21 2007 +0200
@@ -120,12 +120,14 @@ void grabkeys(void); /* grab all keys
 void grabkeys(void); /* grab all keys defined in config.h */
 
 /* layout.c */
+void floating(void); /* arranges all windows floating, fallback layout */
 void focusclient(const char *arg); /* focuses next(1)/previous(-1) visible client */
 void initlayouts(void); /* initialize layout array */
 Client *nexttiled(Client *c); /* returns tiled successor of c */
 void restack(void); /* restores z layers of all clients */
 void setlayout(const char *arg); /* sets layout, NULL means next layout */
 void togglebar(const char *arg); /* shows/hides the bar */
+void togglemax(const char *arg); /* toggles maximization of floating client */
 
 /* main.c */
 void updatebarpos(void); /* updates the bar position */
diff -r d0b93818f723 -r bd5cf635c601 float.c
--- a/float.c Sun Aug 12 12:46:08 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-#include "dwm.h"
-
-/* extern */
-
-void
-floating(void) {
- Client *c;
-
- if(lt->arrange != floating)
- return;
-
- for(c = clients; c; c = c->next)
- if(isvisible(c)) {
- unban(c);
- resize(c, c->x, c->y, c->w, c->h, True);
- }
- else
- ban(c);
- focus(NULL);
- restack();
-}
-
-void
-togglemax(const char *arg) {
- XEvent ev;
-
- if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
- return;
- if((sel->ismax = !sel->ismax)) {
- 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
- resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
- drawstatus();
- while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
-}
diff -r d0b93818f723 -r bd5cf635c601 float.h
--- a/float.h Sun Aug 12 12:46:08 2007 +0200
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-/* See LICENSE file for copyright and license details. */
-
-/* float.c */
-void floating(void); /* arranges all windows floating */
-void togglemax(const char *arg); /* toggles maximization of floating client */
diff -r d0b93818f723 -r bd5cf635c601 layout.c
--- a/layout.c Sun Aug 12 12:46:08 2007 +0200
+++ b/layout.c Sun Aug 12 13:10:21 2007 +0200
@@ -12,6 +12,24 @@ LAYOUTS
 LAYOUTS
 
 /* extern */
+
+void
+floating(void) {
+ Client *c;
+
+ if(lt->arrange != floating)
+ return;
+
+ for(c = clients; c; c = c->next)
+ if(isvisible(c)) {
+ unban(c);
+ resize(c, c->x, c->y, c->w, c->h, True);
+ }
+ else
+ ban(c);
+ focus(NULL);
+ restack();
+}
 
 void
 focusclient(const char *arg) {
@@ -115,3 +133,22 @@ togglebar(const char *arg) {
         updatebarpos();
         lt->arrange();
 }
+
+void
+togglemax(const char *arg) {
+ XEvent ev;
+
+ if(!sel || (lt->arrange != floating && !sel->isfloating) || sel->isfixed)
+ return;
+ if((sel->ismax = !sel->ismax)) {
+ 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
+ resize(sel, sel->rx, sel->ry, sel->rw, sel->rh, True);
+ drawstatus();
+ while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
+}
Received on Sun Aug 12 2007 - 13:13:42 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:51 UTC