diff options
author | okan | 2013-04-12 14:46:30 +0000 |
---|---|---|
committer | okan | 2013-04-12 14:46:30 +0000 |
commit | 41200e99e2cf274538d8533ee449dfa610932e07 (patch) | |
tree | 7107e3565d5617d9d6f0d3c207255a07f576fc92 | |
parent | 631370ead818f5ea4e4cc808f77da7bb909e7b0e (diff) | |
download | cwm-41200e99e2cf274538d8533ee449dfa610932e07.tar.gz |
push Screenq into screen_init
Diffstat (limited to '')
-rw-r--r-- | calmwm.c | 10 | ||||
-rw-r--r-- | calmwm.h | 4 | ||||
-rw-r--r-- | screen.c | 9 |
3 files changed, 12 insertions, 11 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.c,v 1.72 2012/12/18 00:14:41 okan Exp $ + * $OpenBSD: calmwm.c,v 1.73 2013/04/12 14:46:30 okan Exp $ */ #include <sys/param.h> @@ -146,7 +146,6 @@ dpy_init(const char *dpyname) static void x_setup(void) { - struct screen_ctx *sc; struct keybinding *kb; int i; @@ -156,11 +155,8 @@ x_setup(void) Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow); Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner); - for (i = 0; i < ScreenCount(X_Dpy); i++) { - sc = xcalloc(1, sizeof(*sc)); - screen_init(sc, i); - TAILQ_INSERT_TAIL(&Screenq, sc, entry); - } + for (i = 0; i < ScreenCount(X_Dpy); i++) + screen_init(i); /* * XXX key grabs weren't done before, since Screenq was empty, @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: calmwm.h,v 1.186 2013/01/08 15:16:04 okan Exp $ + * $OpenBSD: calmwm.h,v 1.187 2013/04/12 14:46:30 okan Exp $ */ #ifndef _CALMWM_H_ @@ -375,7 +375,7 @@ void search_print_client(struct menu *, int); struct geom screen_find_xinerama(struct screen_ctx *, int, int); struct screen_ctx *screen_fromroot(Window); -void screen_init(struct screen_ctx *, u_int); +void screen_init(u_int); void screen_update_geometry(struct screen_ctx *); void screen_updatestackingorder(struct screen_ctx *); @@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: screen.c,v 1.45 2013/01/08 04:12:51 okan Exp $ + * $OpenBSD: screen.c,v 1.46 2013/04/12 14:46:30 okan Exp $ */ #include <sys/param.h> @@ -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); } |