about summary refs log tree commit diff
path: root/calmwm.c
diff options
context:
space:
mode:
authorokan <okan>2013-06-20 02:33:57 +0000
committerokan <okan>2013-06-20 02:33:57 +0000
commit9a12ca3520e1f8d5673755d0dbe73e9d94bdbc79 (patch)
tree1f679799de165046b7704886b55cde893eff0cc1 /calmwm.c
parentc30653b1c34cff7ca527e15918595e8bea6941c3 (diff)
parent7004700ce0b216f4ea4bb84043acb311928c9a6d (diff)
downloadcwm-9a12ca3520e1f8d5673755d0dbe73e9d94bdbc79.tar.gz
cwm-9a12ca3520e1f8d5673755d0dbe73e9d94bdbc79.tar.xz
cwm-9a12ca3520e1f8d5673755d0dbe73e9d94bdbc79.zip
cvsimport
Diffstat (limited to 'calmwm.c')
-rw-r--r--calmwm.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/calmwm.c b/calmwm.c
index 1ee349e..929fb12 100644
--- a/calmwm.c
+++ b/calmwm.c
@@ -38,12 +38,6 @@
 char				**cwm_argv;
 Display				*X_Dpy;
 
-Cursor				 Cursor_default;
-Cursor				 Cursor_move;
-Cursor				 Cursor_normal;
-Cursor				 Cursor_question;
-Cursor				 Cursor_resize;
-
 struct screen_ctx_q		 Screenq = TAILQ_HEAD_INITIALIZER(Screenq);
 struct client_ctx_q		 Clientq = TAILQ_HEAD_INITIALIZER(Clientq);
 
@@ -52,11 +46,10 @@ struct conf			 Conf;
 char				*homedir;
 
 static void	sigchld_cb(int);
-static void	dpy_init(const char *);
 static int	x_errorhandler(Display *, XErrorEvent *);
-static int	x_wmerrorhandler(Display *, XErrorEvent *);
-static void	x_setup(void);
+static void	x_init(const char *);
 static void	x_teardown(void);
+static int	x_wmerrorhandler(Display *, XErrorEvent *);
 
 int
 main(int argc, char **argv)
@@ -109,15 +102,13 @@ main(int argc, char **argv)
 		conf_path = NULL;
 	}
 
-	dpy_init(display_name);
 
 	conf_init(&Conf);
 	if (conf_path && (parse_config(conf_path, &Conf) == -1))
 		warnx("config file %s has errors, not loading", conf_path);
 	free(conf_path);
 
-	xu_getatoms();
-	x_setup();
+	x_init(display_name);
 	xev_loop();
 	x_teardown();
 
@@ -125,7 +116,7 @@ main(int argc, char **argv)
 }
 
 static void
-dpy_init(const char *dpyname)
+x_init(const char *dpyname)
 {
 	int	i;
 
@@ -139,18 +130,10 @@ dpy_init(const char *dpyname)
 	XSetErrorHandler(x_errorhandler);
 
 	HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
-}
 
-static void
-x_setup(void)
-{
-	int			 i;
+	xu_getatoms();
 
-	Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor);
-	Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);
-	Cursor_normal = XCreateFontCursor(X_Dpy, XC_left_ptr);
-	Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
-	Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
+	conf_cursor(&Conf);
 
 	for (i = 0; i < ScreenCount(X_Dpy); i++)
 		screen_init(i);