about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--dwm.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/dwm.c b/dwm.c
index 0e8c927..6084123 100644
--- a/dwm.c
+++ b/dwm.c
@@ -44,8 +44,8 @@
 #define BUTTONMASK              (ButtonPressMask|ButtonReleaseMask)
 #define CLEANMASK(mask)         (mask & ~(numlockmask|LockMask))
 #define INRECT(X,Y,RX,RY,RW,RH) ((X) >= (RX) && (X) < (RX) + (RW) && (Y) >= (RY) && (Y) < (RY) + (RH))
-#define ISVISIBLE(x)            (x->tags & tagset[mon[x->mon].seltags])
-#define LENGTH(x)               (sizeof x / sizeof x[0])
+#define ISVISIBLE(M, C)         ((M) == (&mon[C->mon]) && (C->tags & tagset[M->seltags]))
+#define LENGTH(X)               (sizeof X / sizeof X[0])
 #define MAX(a, b)               ((a) > (b) ? (a) : (b))
 #define MIN(a, b)               ((a) < (b) ? (a) : (b))
 #define MOUSEMASK               (BUTTONMASK|PointerMotionMask)
@@ -493,7 +493,7 @@ configurenotify(XEvent *e) {
 		updategeom();
 		if(dc.drawable != 0)
 			XFreePixmap(dpy, dc.drawable);
-		dc.drawable = XCreatePixmap(dpy, root, DisplayWidth(dpy, screen), bh, DefaultDepth(dpy, screen));
+		dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
 		for(i = 0; i < nmons; i++)
 			XMoveResizeWindow(dpy, mon[i].barwin, mon[i].wx, mon[i].by, mon[i].ww, bh);
 		arrange();
@@ -524,7 +524,7 @@ configurerequest(XEvent *e) {
 				c->y = sy + (sh / 2 - c->h / 2); /* center in y direction */
 			if((ev->value_mask & (CWX|CWY)) && !(ev->value_mask & (CWWidth|CWHeight)))
 				configure(c);
-			if(ISVISIBLE(c))
+			if(ISVISIBLE((&mon[c->mon]), c))
 				XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
 		}
 		else
@@ -636,6 +636,7 @@ drawbar(Monitor *m) {
 		}
 	}
 	else {
+		dc.x = x;
 		dc.w = m->ww - x;
 		drawtext(NULL, dc.norm, False);
 	}
@@ -718,17 +719,18 @@ expose(XEvent *e) {
 	unsigned int i;
 	XExposeEvent *ev = &e->xexpose;
 
-	for(i = 0; i < nmons; i++)
-		if(ev->count == 0 && (ev->window == mon[i].barwin)) {
-			drawbar(&mon[i]);
-			break;
-		}
+	if(ev->count == 0)
+		for(i = 0; i < nmons; i++)
+			if(ev->window == mon[i].barwin) {
+				drawbar(&mon[i]);
+				break;
+			}
 }
 
 void
 focus(Client *c) {
-	if(!c || !ISVISIBLE(c))
-		for(c = stack; c && !ISVISIBLE(c); c = c->snext);
+	if(!c || !ISVISIBLE((&mon[c->mon]), c))
+		for(c = stack; c && !ISVISIBLE(selmon, c); c = c->snext);
 	if(sel && sel != c) {
 		grabbuttons(sel, False);
 		XSetWindowBorder(dpy, sel->win, dc.norm[ColBorder]);
@@ -776,17 +778,17 @@ focusstack(const Arg *arg) {
 	if(!sel)
 		return;
 	if(arg->i > 0) {
-		for(c = sel->next; c && !ISVISIBLE(c); c = c->next);
+		for(c = sel->next; c && !ISVISIBLE(selmon, c); c = c->next);
 		if(!c)
-			for(c = clients; c && !ISVISIBLE(c); c = c->next);
+			for(c = clients; c && !ISVISIBLE(selmon, c); c = c->next);
 	}
 	else {
 		for(i = clients; i != sel; i = i->next)
-			if(ISVISIBLE(i))
+			if(ISVISIBLE(selmon, i))
 				c = i;
 		if(!c)
 			for(; i; i = i->next)
-				if(ISVISIBLE(i))
+				if(ISVISIBLE(selmon, i))
 					c = i;
 	}
 	if(c) {
@@ -1126,7 +1128,7 @@ movemouse(const Arg *arg) {
 Client *
 nexttiled(Monitor *m, Client *c) {
 	// TODO: m handling
-	for(; c && (c->isfloating || m != &mon[c->mon] || !ISVISIBLE(c)); c = c->next);
+	for(; c && (c->isfloating || !ISVISIBLE(m, c)); c = c->next);
 	return c;
 }
 
@@ -1246,7 +1248,7 @@ restack(Monitor *m) {
 		wc.stack_mode = Below;
 		wc.sibling = m->barwin;
 		for(c = stack; c; c = c->snext)
-			if(!c->isfloating && m == &mon[c->mon] && ISVISIBLE(c)) {
+			if(!c->isfloating && ISVISIBLE(m, c)) {
 				XConfigureWindow(dpy, c->win, CWSibling|CWStackMode, &wc);
 				wc.sibling = c->win;
 			}
@@ -1408,7 +1410,7 @@ void
 showhide(Client *c) {
 	if(!c)
 		return;
-	if(ISVISIBLE(c)) { /* show clients top down */
+	if(ISVISIBLE((&mon[c->mon]), c)) { /* show clients top down */
 		XMoveWindow(dpy, c->win, c->x, c->y);
 		if(!lt[selmon->sellt]->arrange || c->isfloating)
 			resize(c, c->x, c->y, c->w, c->h);
>95e021ae ^
cbcd3325 ^
95e021ae ^















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
                                                              



                                                                     




                                                              




                                                             



                                                          















                                                                          
 






                                                                          






                                                                 
 
                         

                                                   
                         











                                                                           
                         




                                                                           
                         

                                                            
             
 
                         















                                                              
NOTE: This log only documents changes between stable versions.
Stable versions are identifiable (since 1.2) through their even minor
version number, like 1.2.x, 1.4.x, etc.  Odd minor version numbers
are used for rolling-release git snapshots.

2011-04-05: Version 1.4.3
* Fixed mimetype checking when invoking ranger with a filename
* Fixed loss of bookmarks when disk is full
* Minor improvements

2011-03-05: Version 1.4.2
* Added --choosefile and --choosedir flag
* Added use of bookmarks in tab completion of the :cd command
* Fixed bug with detached programs and python 3.2

2011-01-04: Version 1.4.1
* Fixed crash when preview failed under some circumstances
* Fixed graphical bug when pressing i

2010-12-22: Version 1.4.0
* Added option to use any external scripts for previews (see scope.sh)
* Added key: zv to toggle the use of the external script
* Added indicator for the used filter (type "zf")
* Added option padding_right to remove whitespace if theres no preview
* Added command :search_inc for incremental search
* Added commands :save_copy_buffer and :load_copy_buffer to share
  the copied files between ranger instances
* Added mimeopen as a fallback if no useful application can be found
* Added natural sort, sorts 1foo before 10foo. (type "on")
* Added keys: yp, yd and yb to copy path, dirname or basename to seleciton
* Let open_with use the selection, not just one file
* Run files with right mouse click
* Implemented copying via coreutils rather than internal python code
* Improved handling of unicode
* Some restructuration of the source code

2010-12-13: Version 1.2.3
* Enable binding to alt-keys
* Fixed memory leak in garbage collecting of old, unused directory objects
* Fixed python3 incompatibilities
* Fixed problems with identifying changes of files
* Fixed lazy lookup of some FSObject attributes

2010-10-10: Version 1.2.2
* Prevent currently used directories from being garbage collected
* Disable mouse buttons when console is open
* Fixed :cd command: Without arguments, cd's into $HOME
* Fixed bug which prevented pydoc to work on some config files
* Fixed some bugs in "snow" and "jungle" colorschemes
* Several other clean-ups and fixes

2010-09-16: Version 1.2.1
* Fixed yy/pp bug when yanking multiple directories

2010-09-13: Version 1.2.0
* !!! Changed the default configuration directory to ~/.config/ranger !!!
* Removed "Console Modes", each old mode is now a simple command
* Disabled file previews by default if ranger is used by root
* Allow to jump to specific help sections by typing two numbers, e.g. 13?
* Added keys: da, dr, ya, yr for adding and removing files from copy buffer
* Added keys: gl and gL to resolve links, see 11?
* Added key: pL to create a relative symlink
* Added %<LETTER> and %<N><LETTER> macros for the console, see 33?
* Fixed ansi codes for colors in the pager
* Use the file ~/.mime.types for mime type detection
* Several clean-ups and fixes

2010-07-17: Version 1.1.2
* Fix crash when using scrollwheel to scroll down in some cases
* The command "ranger dir1 dir2 ..." opens multiple directories in tabs
* Removed pydoc html documentation by default, re-create it with "make doc"
* Minor fixes

2010-06-18: Version 1.1.1
* New install script, "setup.py"
* New flag for running programs: "w" (waits for enter press)
* Minor fixes

2010-06-09: Version 1.1.0
* Added a man page
* Tab support
* Improved directory loading performance
* Commands are definable in ~/.ranger/commands.py
* Case insensitive sorting (type zs)
* Better UTF support
* Possibility to turn off previews (zp and zP)
* Changing options with :set (e.g. :set column_ratios=1,2,3,4)
* Ask for confirmation when using :delete
* New invocation flag: --fail-unless-cd
* New hotkeys, commands, options.
* New syntax for ~/.ranger/keys.py
* Several user contributions
* And tons of general improvements

NOTE: The syntax for configuration is still subject to change.