Move screen to func "dwm_main"

This commit is contained in:
Alex Kotov 2021-11-22 08:42:31 +05:00
parent 269987ab21
commit 854e9941a3
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -192,7 +192,6 @@ static void restack(Monitor *m);
static void run(); static void run();
static void scan(); static void scan();
static void scheme_destroy(); static void scheme_destroy();
static void screen_init();
static int sendevent(Client *c, Atom proto); static int sendevent(Client *c, Atom proto);
static void sendmon(Client *c, Monitor *m); static void sendmon(Client *c, Monitor *m);
static void setclientstate(Client *c, long state); static void setclientstate(Client *c, long state);
@ -309,7 +308,9 @@ int dwm_main(const char *const new_program_title)
fatal("cannot create atoms"); fatal("cannot create atoms");
} }
screen_init(); screen.x_screen = DefaultScreen(dpy);
screen.sizes.w = DisplayWidth(dpy, screen.x_screen);
screen.sizes.h = DisplayHeight(dpy, screen.x_screen);
root = RootWindow(dpy, screen.x_screen); root = RootWindow(dpy, screen.x_screen);
@ -1651,13 +1652,6 @@ void scheme_destroy()
} }
} }
void screen_init()
{
screen.x_screen = DefaultScreen(dpy);
screen.sizes.w = DisplayWidth(dpy, screen.x_screen);
screen.sizes.h = DisplayHeight(dpy, screen.x_screen);
}
void sendmon(Client *c, Monitor *m) void sendmon(Client *c, Monitor *m)
{ {
if (c->mon == m) if (c->mon == m)