bugfix: don't do stuff RootWindow() with non existent screen (Xinerama)
This commit is contained in:
parent
97a2085705
commit
99ef84e621
18
awesome.c
18
awesome.c
|
@ -69,7 +69,7 @@ cleanup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
{
|
{
|
||||||
XftFontClose(awesomeconf->display, drawcontext->font);
|
XftFontClose(awesomeconf->display, drawcontext->font);
|
||||||
|
|
||||||
XUngrabKey(awesomeconf->display, AnyKey, AnyModifier, RootWindow(awesomeconf->display, screen));
|
XUngrabKey(awesomeconf->display, AnyKey, AnyModifier, RootWindow(awesomeconf->display, awesomeconf[screen].phys_screen));
|
||||||
|
|
||||||
XFreePixmap(awesomeconf->display, awesomeconf[screen].statusbar.drawable);
|
XFreePixmap(awesomeconf->display, awesomeconf[screen].statusbar.drawable);
|
||||||
XFreeGC(awesomeconf->display, drawcontext[screen].gc);
|
XFreeGC(awesomeconf->display, drawcontext[screen].gc);
|
||||||
|
@ -207,8 +207,6 @@ setup(DC *drawcontext, awesome_config *awesomeconf)
|
||||||
initstatusbar(awesomeconf->display, awesomeconf->screen, drawcontext, &awesomeconf->statusbar);
|
initstatusbar(awesomeconf->display, awesomeconf->screen, drawcontext, &awesomeconf->statusbar);
|
||||||
drawcontext->gc = XCreateGC(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), 0, 0);
|
drawcontext->gc = XCreateGC(awesomeconf->display, RootWindow(awesomeconf->display, awesomeconf->phys_screen), 0, 0);
|
||||||
XSetLineAttributes(awesomeconf->display, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
XSetLineAttributes(awesomeconf->display, drawcontext->gc, 1, LineSolid, CapButt, JoinMiter);
|
||||||
|
|
||||||
loadawesomeprops(awesomeconf->display, awesomeconf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Startup Error handler to check if another window manager
|
/** Startup Error handler to check if another window manager
|
||||||
|
@ -321,9 +319,6 @@ main(int argc, char *argv[])
|
||||||
xerrorxlib = XSetErrorHandler(xerror);
|
xerrorxlib = XSetErrorHandler(xerror);
|
||||||
XSync(dpy, False);
|
XSync(dpy, False);
|
||||||
|
|
||||||
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
|
||||||
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
|
||||||
|
|
||||||
/* allocate stuff */
|
/* allocate stuff */
|
||||||
dc = p_new(DC, get_screen_count(dpy));
|
dc = p_new(DC, get_screen_count(dpy));
|
||||||
awesomeconf = p_new(awesome_config, get_screen_count(dpy));
|
awesomeconf = p_new(awesome_config, get_screen_count(dpy));
|
||||||
|
@ -332,9 +327,18 @@ main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
parse_config(dpy, screen, &dc[screen], confpath, &awesomeconf[screen]);
|
parse_config(dpy, screen, &dc[screen], confpath, &awesomeconf[screen]);
|
||||||
setup(&dc[screen], &awesomeconf[screen]);
|
setup(&dc[screen], &awesomeconf[screen]);
|
||||||
|
drawstatusbar(dpy, &dc[screen], &awesomeconf[screen]);
|
||||||
|
}
|
||||||
|
|
||||||
|
netatom[NetSupported] = XInternAtom(dpy, "_NET_SUPPORTED", False);
|
||||||
|
netatom[NetWMName] = XInternAtom(dpy, "_NET_WM_NAME", False);
|
||||||
|
|
||||||
|
/* do this only for real screen */
|
||||||
|
for(screen = 0; screen < ScreenCount(dpy); screen++)
|
||||||
|
{
|
||||||
|
loadawesomeprops(dpy, &awesomeconf[screen]);
|
||||||
XChangeProperty(dpy, RootWindow(dpy, screen), netatom[NetSupported],
|
XChangeProperty(dpy, RootWindow(dpy, screen), netatom[NetSupported],
|
||||||
XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast);
|
XA_ATOM, 32, PropModeReplace, (unsigned char *) netatom, NetLast);
|
||||||
drawstatusbar(dpy, &dc[screen], &awesomeconf[screen]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
handler = p_new(event_handler *, LASTEvent);
|
handler = p_new(event_handler *, LASTEvent);
|
||||||
|
|
8
client.c
8
client.c
|
@ -324,7 +324,7 @@ focus(Display *disp, DC *drawcontext, Client * c, Bool selscreen, awesome_config
|
||||||
setclienttrans(sel, -1);
|
setclienttrans(sel, -1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
XSetInputFocus(disp, RootWindow(disp, awesomeconf->screen), RevertToPointerRoot, CurrentTime);
|
XSetInputFocus(disp, RootWindow(disp, awesomeconf->phys_screen), RevertToPointerRoot, CurrentTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -372,7 +372,7 @@ manage(Display *disp, DC *drawcontext, Window w, XWindowAttributes *wa, awesome_
|
||||||
Window trans;
|
Window trans;
|
||||||
Status rettrans;
|
Status rettrans;
|
||||||
XWindowChanges wc;
|
XWindowChanges wc;
|
||||||
ScreenInfo *si = get_display_info(disp, awesomeconf->screen, &awesomeconf->statusbar);
|
ScreenInfo *si = get_display_info(disp, awesomeconf->phys_screen, &awesomeconf->statusbar);
|
||||||
ScreenInfo *screen_info;
|
ScreenInfo *screen_info;
|
||||||
|
|
||||||
c = p_new(Client, 1);
|
c = p_new(Client, 1);
|
||||||
|
@ -643,7 +643,7 @@ set_shape(Client *c)
|
||||||
/* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */
|
/* Logic to decide if we have a shaped window cribbed from fvwm-2.5.10. */
|
||||||
if (XShapeQueryExtents(c->display, c->win, &bounding_shaped, &i, &i,
|
if (XShapeQueryExtents(c->display, c->win, &bounding_shaped, &i, &i,
|
||||||
&u, &u, &b, &i, &i, &u, &u) && bounding_shaped)
|
&u, &u, &b, &i, &i, &u, &u) && bounding_shaped)
|
||||||
XShapeCombineShape(c->display, RootWindow(c->display, c->screen), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet);
|
XShapeCombineShape(c->display, RootWindow(c->display, c->phys_screen), ShapeBounding, 0, 0, c->win, ShapeBounding, ShapeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set selected client transparency
|
/** Set selected client transparency
|
||||||
|
@ -784,7 +784,7 @@ uicb_moveresize(Display *disp __attribute__ ((unused)),
|
||||||
ow = sel->w;
|
ow = sel->w;
|
||||||
oh = sel->h;
|
oh = sel->h;
|
||||||
|
|
||||||
Bool xqp = XQueryPointer(sel->display, RootWindow(sel->display, sel->screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
|
Bool xqp = XQueryPointer(sel->display, RootWindow(sel->display, sel->phys_screen), &dummy, &dummy, &mx, &my, &dx, &dy, &dui);
|
||||||
resize(sel, nx, ny, nw, nh, awesomeconf, True);
|
resize(sel, nx, ny, nw, nh, awesomeconf, True);
|
||||||
if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my)
|
if (xqp && ox <= mx && (ox + ow) >= mx && oy <= my && (oy + oh) >= my)
|
||||||
{
|
{
|
||||||
|
|
2
event.c
2
event.c
|
@ -452,7 +452,7 @@ handle_event_unmapnotify(XEvent * e, awesome_config *awesomeconf)
|
||||||
XUnmapEvent *ev = &e->xunmap;
|
XUnmapEvent *ev = &e->xunmap;
|
||||||
|
|
||||||
if((c = getclient(ev->window))
|
if((c = getclient(ev->window))
|
||||||
&& ev->event == RootWindow(e->xany.display, c->screen) && (ev->send_event || !c->unmapped))
|
&& ev->event == RootWindow(e->xany.display, c->phys_screen) && (ev->send_event || !c->unmapped))
|
||||||
unmanage(c, &dc[c->screen], WithdrawnState, &awesomeconf[c->screen]);
|
unmanage(c, &dc[c->screen], WithdrawnState, &awesomeconf[c->screen]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
layout.c
4
layout.c
|
@ -106,7 +106,7 @@ loadawesomeprops(Display *disp, awesome_config * awesomeconf)
|
||||||
|
|
||||||
prop = p_new(char, awesomeconf->ntags + 1);
|
prop = p_new(char, awesomeconf->ntags + 1);
|
||||||
|
|
||||||
if(xgettextprop(disp, RootWindow(disp, awesomeconf->screen), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1))
|
if(xgettextprop(disp, RootWindow(disp, awesomeconf->phys_screen), AWESOMEPROPS_ATOM(disp), prop, awesomeconf->ntags + 1))
|
||||||
for(i = 0; i < awesomeconf->ntags && prop[i]; i++)
|
for(i = 0; i < awesomeconf->ntags && prop[i]; i++)
|
||||||
awesomeconf->tags[i].selected = prop[i] == '1';
|
awesomeconf->tags[i].selected = prop[i] == '1';
|
||||||
|
|
||||||
|
@ -156,7 +156,7 @@ saveawesomeprops(Display *disp, awesome_config *awesomeconf)
|
||||||
for(i = 0; i < awesomeconf->ntags; i++)
|
for(i = 0; i < awesomeconf->ntags; i++)
|
||||||
prop[i] = awesomeconf->tags[i].selected ? '1' : '0';
|
prop[i] = awesomeconf->tags[i].selected ? '1' : '0';
|
||||||
prop[i] = '\0';
|
prop[i] = '\0';
|
||||||
XChangeProperty(disp, RootWindow(disp, awesomeconf->screen),
|
XChangeProperty(disp, RootWindow(disp, awesomeconf->phys_screen),
|
||||||
AWESOMEPROPS_ATOM(disp), XA_STRING, 8,
|
AWESOMEPROPS_ATOM(disp), XA_STRING, 8,
|
||||||
PropModeReplace, (unsigned char *) prop, i);
|
PropModeReplace, (unsigned char *) prop, i);
|
||||||
p_delete(&prop);
|
p_delete(&prop);
|
||||||
|
|
Loading…
Reference in New Issue