mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
querying for Xinerama should be done per display, not per screen, so
move chuck to display init; allows some shuffling to occur limiting screen_init_xinerama()'s scope while keeping order intact.
This commit is contained in:
parent
315f25f7ab
commit
cb893d0aa9
15
calmwm.c
15
calmwm.c
@ -97,7 +97,7 @@ main(int argc, char **argv)
|
|||||||
static void
|
static void
|
||||||
dpy_init(const char *dpyname)
|
dpy_init(const char *dpyname)
|
||||||
{
|
{
|
||||||
int i;
|
int i, fake;
|
||||||
|
|
||||||
XSetErrorHandler(x_errorhandler);
|
XSetErrorHandler(x_errorhandler);
|
||||||
|
|
||||||
@ -110,6 +110,9 @@ dpy_init(const char *dpyname)
|
|||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
XSetErrorHandler(x_errorhandler);
|
XSetErrorHandler(x_errorhandler);
|
||||||
|
|
||||||
|
if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 &&
|
||||||
|
((HasXinerama = XineramaIsActive(X_Dpy)) == 1))
|
||||||
|
HasXinerama = 1;
|
||||||
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
HasRandr = XRRQueryExtension(X_Dpy, &Randr_ev, &i);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,7 +160,6 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
Window *wins, w0, w1;
|
Window *wins, w0, w1;
|
||||||
XWindowAttributes winattr;
|
XWindowAttributes winattr;
|
||||||
XSetWindowAttributes rootattr;
|
XSetWindowAttributes rootattr;
|
||||||
int fake;
|
|
||||||
u_int nwins, i;
|
u_int nwins, i;
|
||||||
|
|
||||||
sc->which = which;
|
sc->which = which;
|
||||||
@ -201,17 +203,8 @@ x_setupscreen(struct screen_ctx *sc, u_int which)
|
|||||||
|
|
||||||
screen_updatestackingorder(sc);
|
screen_updatestackingorder(sc);
|
||||||
|
|
||||||
if (XineramaQueryExtension(X_Dpy, &fake, &fake) == 1 &&
|
|
||||||
((HasXinerama = XineramaIsActive(X_Dpy)) == 1))
|
|
||||||
HasXinerama = 1;
|
|
||||||
if (HasRandr)
|
if (HasRandr)
|
||||||
XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
|
XRRSelectInput(X_Dpy, sc->rootwin, RRScreenChangeNotifyMask);
|
||||||
/*
|
|
||||||
* initial setup of xinerama screens, if we're using RandR then we'll
|
|
||||||
* redo this whenever the screen changes since a CTRC may have been
|
|
||||||
* added or removed
|
|
||||||
*/
|
|
||||||
screen_init_xinerama(sc);
|
|
||||||
|
|
||||||
XSync(X_Dpy, False);
|
XSync(X_Dpy, False);
|
||||||
}
|
}
|
||||||
|
1
calmwm.h
1
calmwm.h
@ -360,7 +360,6 @@ void search_print_client(struct menu *, int);
|
|||||||
|
|
||||||
XineramaScreenInfo *screen_find_xinerama(struct screen_ctx *, int, int);
|
XineramaScreenInfo *screen_find_xinerama(struct screen_ctx *, int, int);
|
||||||
struct screen_ctx *screen_fromroot(Window);
|
struct screen_ctx *screen_fromroot(Window);
|
||||||
void screen_init_xinerama(struct screen_ctx *);
|
|
||||||
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 *);
|
||||||
|
|
||||||
|
8
screen.c
8
screen.c
@ -30,6 +30,8 @@
|
|||||||
|
|
||||||
#include "calmwm.h"
|
#include "calmwm.h"
|
||||||
|
|
||||||
|
static void screen_init_xinerama(struct screen_ctx *);
|
||||||
|
|
||||||
struct screen_ctx *
|
struct screen_ctx *
|
||||||
screen_fromroot(Window rootwin)
|
screen_fromroot(Window rootwin)
|
||||||
{
|
{
|
||||||
@ -65,6 +67,10 @@ screen_updatestackingorder(struct screen_ctx *sc)
|
|||||||
XFree(wins);
|
XFree(wins);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If we're using RandR then we'll redo this whenever the screen
|
||||||
|
* changes since a CTRC may have been added or removed
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
screen_init_xinerama(struct screen_ctx *sc)
|
screen_init_xinerama(struct screen_ctx *sc)
|
||||||
{
|
{
|
||||||
@ -114,6 +120,8 @@ screen_update_geometry(struct screen_ctx *sc)
|
|||||||
sc->xmax = DisplayWidth(X_Dpy, sc->which);
|
sc->xmax = DisplayWidth(X_Dpy, sc->which);
|
||||||
sc->ymax = DisplayHeight(X_Dpy, sc->which);
|
sc->ymax = DisplayHeight(X_Dpy, sc->which);
|
||||||
|
|
||||||
|
screen_init_xinerama(sc);
|
||||||
|
|
||||||
xu_ewmh_net_desktop_geometry(sc);
|
xu_ewmh_net_desktop_geometry(sc);
|
||||||
xu_ewmh_net_workarea(sc);
|
xu_ewmh_net_workarea(sc);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user