summary refs log tree commit diff
path: root/xevents.c
diff options
context:
space:
mode:
authorokan <okan>2019-03-07 14:28:17 +0000
committerokan <okan>2019-03-07 14:28:17 +0000
commit7c45b87622c069a176359df3c632086540a7fe3f (patch)
tree9b515d87072ce60074e2ab985383acc3f8f28fae /xevents.c
parent01be5b4e4a04e5f454d0e685c71c8023c7c0b731 (diff)
downloadcwm-7c45b87622c069a176359df3c632086540a7fe3f.tar.gz
cwm-7c45b87622c069a176359df3c632086540a7fe3f.tar.xz
cwm-7c45b87622c069a176359df3c632086540a7fe3f.zip
Teach client_current() to use a screen to find the current client instead of
iterating over all (fallback if no screen provided for now). Initially convert
trivial uses of client_current().
Diffstat (limited to 'xevents.c')
-rw-r--r--xevents.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xevents.c b/xevents.c
index 6c73b62..8bbd525 100644
--- a/xevents.c
+++ b/xevents.c
@@ -79,7 +79,7 @@ xev_handle_maprequest(XEvent *ee)
 
 	LOG_DEBUG3("window: 0x%lx", e->window);
 
-	if ((old_cc = client_current()) != NULL)
+	if ((old_cc = client_current(NULL)) != NULL)
 		client_ptrsave(old_cc);
 
 	if ((cc = client_find(e->window)) == NULL)
@@ -249,7 +249,7 @@ xev_handle_buttonpress(XEvent *ee)
 	switch (mb->context) {
 	case CWM_CONTEXT_CC:
 		if (((cc = client_find(e->window)) == NULL) &&
-		    (cc = client_current()) == NULL)
+		    (cc = client_current(NULL)) == NULL)
 			return;
 		(*mb->callback)(cc, mb->cargs);
 		break;
@@ -318,7 +318,7 @@ xev_handle_keypress(XEvent *ee)
 	switch (kb->context) {
 	case CWM_CONTEXT_CC:
 		if (((cc = client_find(e->window)) == NULL) &&
-		    (cc = client_current()) == NULL)
+		    (cc = client_current(NULL)) == NULL)
 			return;
 		(*kb->callback)(cc, kb->cargs);
 		break;
@@ -353,7 +353,7 @@ xev_handle_keyrelease(XEvent *ee)
 	keysym = XkbKeycodeToKeysym(X_Dpy, e->keycode, 0, 0);
 	for (i = 0; i < nitems(modkeys); i++) {
 		if (keysym == modkeys[i]) {
-			if ((cc = client_current()) != NULL) {
+			if ((cc = client_current(NULL)) != NULL) {
 				if (sc->cycling) {
 					sc->cycling = 0;
 					client_mtf(cc);
@@ -389,7 +389,7 @@ xev_handle_clientmessage(XEvent *ee)
 		}
 	} else if (e->message_type == ewmh[_NET_ACTIVE_WINDOW]) {
 		if ((cc = client_find(e->window)) != NULL) {
-			if ((old_cc = client_current()) != NULL)
+			if ((old_cc = client_current(NULL)) != NULL)
 				client_ptrsave(old_cc);
 			client_show(cc);
 			client_ptrwarp(cc);