now that we have conf_screen, which configures individual screens

*after* config parsing, we no longer need to split up display/screen
initialization, so collapse.
This commit is contained in:
okan 2013-06-17 14:08:51 +00:00
parent 8b00f438be
commit 23d84adb5e

View File

@ -52,11 +52,10 @@ struct conf Conf;
char *homedir; char *homedir;
static void sigchld_cb(int); static void sigchld_cb(int);
static void dpy_init(const char *);
static int x_errorhandler(Display *, XErrorEvent *); static int x_errorhandler(Display *, XErrorEvent *);
static int x_wmerrorhandler(Display *, XErrorEvent *); static void x_init(const char *);
static void x_setup(void);
static void x_teardown(void); static void x_teardown(void);
static int x_wmerrorhandler(Display *, XErrorEvent *);
int int
main(int argc, char **argv) main(int argc, char **argv)
@ -109,15 +108,13 @@ main(int argc, char **argv)
conf_path = NULL; conf_path = NULL;
} }
dpy_init(display_name);
conf_init(&Conf); conf_init(&Conf);
if (conf_path && (parse_config(conf_path, &Conf) == -1)) if (conf_path && (parse_config(conf_path, &Conf) == -1))
warnx("config file %s has errors, not loading", conf_path); warnx("config file %s has errors, not loading", conf_path);
free(conf_path); free(conf_path);
xu_getatoms(); x_init(display_name);
x_setup();
xev_loop(); xev_loop();
x_teardown(); x_teardown();
@ -125,7 +122,7 @@ main(int argc, char **argv)
} }
static void static void
dpy_init(const char *dpyname) x_init(const char *dpyname)
{ {
int i; int i;
@ -139,12 +136,8 @@ dpy_init(const char *dpyname)
XSetErrorHandler(x_errorhandler); XSetErrorHandler(x_errorhandler);
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i); HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
}
static void xu_getatoms();
x_setup(void)
{
int i;
Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor); Cursor_default = XCreateFontCursor(X_Dpy, XC_X_cursor);
Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur); Cursor_move = XCreateFontCursor(X_Dpy, XC_fleur);