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.
This commit is contained in:
		
				
					committed by
					
						
						Roberto E. Vargas Caballero
					
				
			
			
				
	
			
			
			
						parent
						
							cd159883d1
						
					
				
				
					commit
					008aae541b
				
			
							
								
								
									
										4
									
								
								st.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								st.c
									
									
									
									
									
								
							@ -3136,8 +3136,8 @@ xinit(void) {
 | 
				
			|||||||
		| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
 | 
							| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
 | 
				
			||||||
	xw.attrs.colormap = xw.cmap;
 | 
						xw.attrs.colormap = xw.cmap;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	parent = opt_embed ? strtol(opt_embed, NULL, 0) : \
 | 
						if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
 | 
				
			||||||
			XRootWindow(xw.dpy, xw.scr);
 | 
							parent = XRootWindow(xw.dpy, xw.scr);
 | 
				
			||||||
	xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
 | 
						xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
 | 
				
			||||||
			xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
 | 
								xw.w, xw.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
 | 
				
			||||||
			xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
 | 
								xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user