diff options
| author | Quentin Rameau <quinq.ml@gmail.com> | 2014-10-16 00:42:53 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2014-10-21 18:18:26 +0200 |
| commit | 008aae541b5cb1e67a025048adef9a06eaa11c2e (patch) | |
| tree | 4d610d019e56376e99c9abc3e28962dc6e41963a | |
| parent | Reverting smacs and rmacs to the xterm defaults. (diff) | |
| download | st-008aae541b5cb1e67a025048adef9a06eaa11c2e.tar.gz st-008aae541b5cb1e67a025048adef9a06eaa11c2e.zip | |
Avoid failing when embedding with a Window id of 0
I'd like to let st run with its own window when trying to embed it to a window with id 0 instead of exiting with an error.
| -rw-r--r-- | st.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -3136,8 +3136,8 @@ xinit(void) { | |||
| 3136 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; | 3136 | | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; |
| 3137 | xw.attrs.colormap = xw.cmap; | 3137 | xw.attrs.colormap = xw.cmap; |
| 3138 | 3138 | ||
| 3139 | parent = opt_embed ? strtol(opt_embed, NULL, 0) : \ | 3139 | if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) |
| 3140 | XRootWindow(xw.dpy, xw.scr); | 3140 | parent = XRootWindow(xw.dpy, xw.scr); |
| 3141 | xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, | 3141 | xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t, |
| 3142 | xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, | 3142 | xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput, |
| 3143 | xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity | 3143 | xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity |
