about summary refs log tree commit diff
path: root/screen.c
diff options
context:
space:
mode:
authorokan <okan>2013-04-12 14:46:30 +0000
committerokan <okan>2013-04-12 14:46:30 +0000
commit6296efadaa6bcc09068030bec4cb01904ca1a010 (patch)
tree45ea8b0efcb09a022ef8c6e1097334c6da1e48ad /screen.c
parent90f95416c6f4461625dd37d5cc44dd92a067a030 (diff)
downloadcwm-6296efadaa6bcc09068030bec4cb01904ca1a010.tar.gz
cwm-6296efadaa6bcc09068030bec4cb01904ca1a010.tar.xz
cwm-6296efadaa6bcc09068030bec4cb01904ca1a010.zip
push Screenq into screen_init
Diffstat (limited to 'screen.c')
-rw-r--r--screen.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/screen.c b/screen.c
index 6b7de6b..7eac18d 100644
--- a/screen.c
+++ b/screen.c
@@ -31,13 +31,16 @@
 #include "calmwm.h"
 
 void
-screen_init(struct screen_ctx *sc, u_int which)
+screen_init(u_int which)
 {
+	struct screen_ctx	*sc;
 	Window			*wins, w0, w1;
 	XWindowAttributes	 winattr;
 	XSetWindowAttributes	 rootattr;
 	u_int			 nwins, i;
 
+	sc = xcalloc(1, sizeof(*sc));
+
 	sc->which = which;
 	sc->visual = DefaultVisual(X_Dpy, sc->which);
 	sc->colormap = DefaultColormap(X_Dpy, sc->which);
@@ -84,6 +87,8 @@ screen_init(struct screen_ctx *sc, u_int which)
 	if (HasRandr)
 		XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
 
+	TAILQ_INSERT_TAIL(&Screenq, sc, entry);
+
 	XSync(X_Dpy, False);
 }