mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
push Screenq into screen_init
This commit is contained in:
parent
90f95416c6
commit
6296efadaa
8
calmwm.c
8
calmwm.c
@ -146,7 +146,6 @@ dpy_init(const char *dpyname)
|
|||||||
static void
|
static void
|
||||||
x_setup(void)
|
x_setup(void)
|
||||||
{
|
{
|
||||||
struct screen_ctx *sc;
|
|
||||||
struct keybinding *kb;
|
struct keybinding *kb;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@ -156,11 +155,8 @@ x_setup(void)
|
|||||||
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
Cursor_question = XCreateFontCursor(X_Dpy, XC_question_arrow);
|
||||||
Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
|
Cursor_resize = XCreateFontCursor(X_Dpy, XC_bottom_right_corner);
|
||||||
|
|
||||||
for (i = 0; i < ScreenCount(X_Dpy); i++) {
|
for (i = 0; i < ScreenCount(X_Dpy); i++)
|
||||||
sc = xcalloc(1, sizeof(*sc));
|
screen_init(i);
|
||||||
screen_init(sc, i);
|
|
||||||
TAILQ_INSERT_TAIL(&Screenq, sc, entry);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* XXX key grabs weren't done before, since Screenq was empty,
|
* XXX key grabs weren't done before, since Screenq was empty,
|
||||||
|
2
calmwm.h
2
calmwm.h
@ -375,7 +375,7 @@ void search_print_client(struct menu *, int);
|
|||||||
|
|
||||||
struct geom screen_find_xinerama(struct screen_ctx *, int, int);
|
struct geom screen_find_xinerama(struct screen_ctx *, int, int);
|
||||||
struct screen_ctx *screen_fromroot(Window);
|
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_update_geometry(struct screen_ctx *);
|
||||||
void screen_updatestackingorder(struct screen_ctx *);
|
void screen_updatestackingorder(struct screen_ctx *);
|
||||||
|
|
||||||
|
7
screen.c
7
screen.c
@ -31,13 +31,16 @@
|
|||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
void
|
void
|
||||||
screen_init(struct screen_ctx *sc, u_int which)
|
screen_init(u_int which)
|
||||||
{
|
{
|
||||||
|
struct screen_ctx *sc;
|
||||||
Window *wins, w0, w1;
|
Window *wins, w0, w1;
|
||||||
XWindowAttributes winattr;
|
XWindowAttributes winattr;
|
||||||
XSetWindowAttributes rootattr;
|
XSetWindowAttributes rootattr;
|
||||||
u_int nwins, i;
|
u_int nwins, i;
|
||||||
|
|
||||||
|
sc = xcalloc(1, sizeof(*sc));
|
||||||
|
|
||||||
sc->which = which;
|
sc->which = which;
|
||||||
sc->visual = DefaultVisual(X_Dpy, sc->which);
|
sc->visual = DefaultVisual(X_Dpy, sc->which);
|
||||||
sc->colormap = DefaultColormap(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)
|
if (HasRandr)
|
||||||
XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
|
XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
|
||||||
|
|
||||||
|
TAILQ_INSERT_TAIL(&Screenq, sc, entry);
|
||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user