diff options
| author | Aiden Gall <aiden@aidengall.xyz> | 2024-11-27 22:58:25 +0000 |
|---|---|---|
| committer | Aiden Gall <aiden@aidengall.xyz> | 2024-11-27 22:58:25 +0000 |
| commit | 2f55584aad1d25de361752831ef0ba0162289f53 (patch) | |
| tree | 8bf7be3140b0312c6b380ee1b58e3a080e835e18 | |
| parent | 6b1898dce6eb8bb32391a833f03abcf9404b9e5b (diff) | |
| parent | a0274bc20e11d8672bb2953fdd1d3010c0e708c5 (diff) | |
merge upstream
| -rw-r--r-- | x.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -1144,7 +1144,7 @@ xinit(int cols, int rows) { XGCValues gcvalues; Cursor cursor; - Window parent; + Window parent, root; pid_t thispid = getpid(); XColor xmousefg, xmousebg; XWindowAttributes attr; @@ -1154,11 +1154,12 @@ xinit(int cols, int rows) die("can't open display\n"); xw.scr = XDefaultScreen(xw.dpy); + root = XRootWindow(xw.dpy, xw.scr); if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) { - parent = XRootWindow(xw.dpy, xw.scr); + parent = root; xw.depth = 32; } else { - XGetWindowAttributes(xw.dpy, parent, &attr); + XGetWindowAttributes(xw.dpy, root, &attr); xw.depth = attr.depth; } @@ -1173,7 +1174,7 @@ xinit(int cols, int rows) xloadfonts(usedfont, 0); /* colors */ - xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); + xw.cmap = XCreateColormap(xw.dpy, root, xw.vis, None); xloadcols(); /* adjust fixed window geometry */ @@ -1193,10 +1194,12 @@ xinit(int cols, int rows) | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; xw.attrs.colormap = xw.cmap; - xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, + xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t, win.w, win.h, 0, xw.depth, InputOutput, xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask | CWColormap, &xw.attrs); + if (parent != root) + XReparentWindow(xw.dpy, xw.win, parent, xw.l, xw.t); memset(&gcvalues, 0, sizeof(gcvalues)); gcvalues.graphics_exposures = False; |
