if (XQueryPointer(display, screens[i].root,
&rr, &cr, &x, &y, &wx, &wy, &mask) == False) {
r = TAILQ_FIRST(&screens[i].rl);
} else {
TAILQ_FOREACH(r, &screens[i].rl, entry) {
if (x > X(r) && x < X(r) + WIDTH(r) &&
if (XQueryPointer(display, screens[i].root,
&rr, &cr, &x, &y, &wx, &wy, &mask) == False) {
r = TAILQ_FIRST(&screens[i].rl);
} else {
TAILQ_FOREACH(r, &screens[i].rl, entry) {
if (x > X(r) && x < X(r) + WIDTH(r) &&
/* map new window first to prevent ugly blinking */
TAILQ_FOREACH(win, &new_ws->winlist, entry)
/* map new window first to prevent ugly blinking */
TAILQ_FOREACH(win, &new_ws->winlist, entry)
- int i;
- struct swm_region *r;
- DNPRINTF(SWM_D_EVENT, "visibilitynotify: window: %lu\n", e->xvisibility.window);
+ int i;
+ struct swm_region *r;
+
+ DNPRINTF(SWM_D_EVENT, "visibilitynotify: window: %lu\n",
+ e->xvisibility.window);
if (e->xvisibility.state == VisibilityUnobscured)
for (i = 0; i < ScreenCount(display); i++)
TAILQ_FOREACH(r, &screens[i].rl, entry)
if (e->xvisibility.state == VisibilityUnobscured)
for (i = 0; i < ScreenCount(display); i++)
TAILQ_FOREACH(r, &screens[i].rl, entry)
new_region(struct swm_screen *s, struct workspace *ws,
int x, int y, int w, int h)
{
new_region(struct swm_screen *s, struct workspace *ws,
int x, int y, int w, int h)
{
DNPRINTF(SWM_D_MISC, "new region on screen %d: %dx%d (%d, %d)\n",
s->idx, x, y, w, h);
DNPRINTF(SWM_D_MISC, "new region on screen %d: %dx%d (%d, %d)\n",
s->idx, x, y, w, h);
+#ifdef SWM_XRR_HAS_CRTC
+ XRRCrtcInfo *ci;
+ XRRScreenResources *sr;
+ int c;
+#endif /* SWM_XRR_HAS_CRTC */
+ Window d1, d2, *wins = NULL;
+ XWindowAttributes wa;
+ struct swm_region *r;
+ unsigned int num;
+ int errorbase, major, minor;
+ int ncrtc, w = 0;
+ int i, j, k;
+ struct workspace *ws;
if ((screens = calloc(ScreenCount(display),
sizeof(struct swm_screen))) == NULL)
if ((screens = calloc(ScreenCount(display),
sizeof(struct swm_screen))) == NULL)
-#ifdef SWM_XRR_HAS_CRTC
- XRRCrtcInfo *crtc_info;
- XRRScreenResources *res;
- int c;
-#endif /* SWM_XRR_HAS_CRTC */
- Window d1, d2, *wins = NULL;
- XWindowAttributes wa;
- struct swm_region *r;
- int errorbase, major, minor;
- int j, ncrtc, w = 0;
- unsigned int num;
-
+ DNPRINTF(SWM_D_WS, "setup_screens: init screen %d\n", i);
screens[i].idx = i;
TAILQ_INIT(&screens[i].rl);
screens[i].root = RootWindow(display, i);
screens[i].idx = i;
TAILQ_INIT(&screens[i].rl);
screens[i].root = RootWindow(display, i);
ncrtc = 0;
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),
DisplayHeight(display, i));
} else
ncrtc = 0;
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),
DisplayHeight(display, i));
} else
- crtc_info = XRRGetCrtcInfo(display, res, res->crtcs[c]);
- if (crtc_info != NULL && crtc_info->mode == None)
+ ci = XRRGetCrtcInfo(display, sr, sr->crtcs[c]);
+ if (ci->noutput == 0)
+ continue;
+
+ if (ci != NULL && ci->mode == None)
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),
DisplayHeight(display, i));
else
new_region(&screens[i], &screens[i].ws[w],
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),
DisplayHeight(display, i));
else
new_region(&screens[i], &screens[i].ws[w],
- crtc_info->x, crtc_info->y,
- crtc_info->width, crtc_info->height);
+ ci->x, ci->y, ci->width, ci->height);
#else
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),
#else
new_region(&screens[i], &screens[i].ws[w],
0, 0, DisplayWidth(display, i),