diff options
Diffstat (limited to 'x.c')
| -rw-r--r-- | x.c | 11 |
1 files changed, 7 insertions, 4 deletions
| @@ -1131,7 +1131,7 @@ xinit(int cols, int rows) | |||
| 1131 | { | 1131 | { |
| 1132 | XGCValues gcvalues; | 1132 | XGCValues gcvalues; |
| 1133 | Cursor cursor; | 1133 | Cursor cursor; |
| 1134 | Window parent; | 1134 | Window parent, root; |
| 1135 | pid_t thispid = getpid(); | 1135 | pid_t thispid = getpid(); |
| 1136 | XColor xmousefg, xmousebg; | 1136 | XColor xmousefg, xmousebg; |
| 1137 | 1137 | ||
| @@ -1168,16 +1168,19 @@ xinit(int cols, int rows) | |||
| 1168 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | 1168 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; |
| 1169 | xw.attrs.colormap = xw.cmap; | 1169 | xw.attrs.colormap = xw.cmap; |
| 1170 | 1170 | ||
| 1171 | root = XRootWindow(xw.dpy, xw.scr); | ||
| 1171 | if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) | 1172 | if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) |
| 1172 | parent = XRootWindow(xw.dpy, xw.scr); | 1173 | parent = root; |
| 1173 | xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, | 1174 | xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t, |
| 1174 | win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, | 1175 | win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, |
| 1175 | xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | 1176 | xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity |
| 1176 | | CWEventMask | CWColormap, &xw.attrs); | 1177 | | CWEventMask | CWColormap, &xw.attrs); |
| 1178 | if (parent != root) | ||
| 1179 | XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t); | ||
| 1177 | 1180 | ||
| 1178 | memset(&gcvalues, 0, sizeof(gcvalues)); | 1181 | memset(&gcvalues, 0, sizeof(gcvalues)); |
| 1179 | gcvalues.graphics_exposures = False; | 1182 | gcvalues.graphics_exposures = False; |
| 1180 | dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures, | 1183 | dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures, |
| 1181 | &gcvalues); | 1184 | &gcvalues); |
| 1182 | xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, | 1185 | xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, |
| 1183 | DefaultDepth(xw.dpy, xw.scr)); | 1186 | DefaultDepth(xw.dpy, xw.scr)); |
