summaryrefslogtreecommitdiff
path: root/x11-wm/jewel/files/patch-windowmanager.cc
blob: 1bb1c40cf438a641ab859744fae94d5714678792 (plain) (blame)
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
--- windowmanager.cc.orig	2007-12-06 20:41:35.000000000 +0100
+++ windowmanager.cc	2007-12-06 20:47:01.000000000 +0100
@@ -51,24 +51,24 @@
 	// Set the global window manager object to this please =)
     	wm = this;
 	
-	window_manager_name="jewel";
+	window_manager_name=(char *)"jewel";
 
 	// Make the default options equal something
-    	opt_font = DEF_FONT;
-	opt_fm = DEF_FM;
-    	opt_fg = DEF_FG;
-    	opt_fc = DEF_FC;
-    	opt_bg = DEF_BG;
-    	opt_bd = DEF_BD;
-    	opt_tj = TEXT_JUSTIFY;
-	opt_wm = WIRE_MOVE;
-	opt_es = EDGE_SNAP;
-	opt_newkey = DEF_NEWKEY;
-    	opt_new1 = DEF_NEW1;
-    	opt_new2 = DEF_NEW2;
+    	opt_font = (char *)DEF_FONT;
+	   opt_fm = (char *)DEF_FM;
+    	opt_fg = (char *)DEF_FG;
+    	opt_fc = (char *)DEF_FC;
+    	opt_bg = (char *)DEF_BG;
+    	opt_bd = (char *)DEF_BD;
+    	opt_tj = (char *)TEXT_JUSTIFY;
+	   opt_wm = (char *)WIRE_MOVE;
+	   opt_es = (char *)EDGE_SNAP;
+	   opt_newkey = (char *)DEF_NEWKEY;
+    	opt_new1 = (char *)DEF_NEW1;
+    	opt_new2 = (char *)DEF_NEW2;
     	opt_bw = DEF_BW;
     	opt_display=NULL;
-	maxDesktops=MAX_DESKTOPS;
+	   maxDesktops=MAX_DESKTOPS;
 
 // These macro's are nice to test values passed in 
 // the command line arguments	
@@ -1557,21 +1557,21 @@
 		// find the client in the list...
 		it = find(clientList->begin(), clientList->end(), c);
 
-		if ( it == NULL || it == clientList->end()) {
+		if ( it == clientList->end()) {
 			it = clientList->begin();
 		}
 
 		do {
 			cycles++;
-			if ( it != clientList->end() && it != NULL ) {
+			if ( it == clientList->end() ) {
+				it = clientList->begin();
+			}
+			else {
 				it++;
 				if ( it == clientList->end() ) {
 					it = clientList->begin();
 				}
 			}
-			else {
-				it = clientList->begin();
-			}
 		} while (cycles < clientList->size() && (shouldSkipThisWindow((*it)->getAppWindow()) || (*it)->isIconified() || (*it)->belongsToWhichDesktop() != currentDesktop));
 		
 #ifdef DEBUG
@@ -1588,7 +1588,7 @@
 
 		// if we found a suitable "next client", raise and focus
 		// it; otherwise, leave focus where it is
-		if ( cycles < clientList->size() && it != NULL && it != clientList->end() && !shouldSkipThisWindow((*it)->getAppWindow()) && !(*it)->isIconified() && (*it)->belongsToWhichDesktop() == currentDesktop && !shouldSkipThisWindow((*it)->getAppWindow())) {
+		if ( cycles < clientList->size() && !(it == clientList->end()) && !shouldSkipThisWindow((*it)->getAppWindow()) && !(*it)->isIconified() && (*it)->belongsToWhichDesktop() == currentDesktop && !shouldSkipThisWindow((*it)->getAppWindow())) {
 			c = *it;
 			c->raise();
 			setFocusedClient(c);