added thread names
added automatic destroying if one client terminates
This commit is contained in:
		
							parent
							
								
									0b23d8bf08
								
							
						
					
					
						commit
						fbc1478a17
					
				| 
						 | 
				
			
			@ -22,8 +22,10 @@
 | 
			
		|||
	     (manager-type split) split-wm-options-spec
 | 
			
		||||
	     external-in-channel
 | 
			
		||||
	     (lambda (wm in-channel)
 | 
			
		||||
	       (spawn (lambda ()
 | 
			
		||||
			(split-wm-handler wm in-channel)))
 | 
			
		||||
	       (spawn* (list 'split-wm wm)
 | 
			
		||||
		       (lambda (release)
 | 
			
		||||
			 (release)
 | 
			
		||||
			 (split-wm-handler wm in-channel)))
 | 
			
		||||
	       wm)))
 | 
			
		||||
 | 
			
		||||
(define (split-wm? wm)
 | 
			
		||||
| 
						 | 
				
			
			@ -73,8 +75,12 @@
 | 
			
		|||
		 (set! first-client #f))
 | 
			
		||||
	     (if (eq? client second-client)
 | 
			
		||||
		 (set! second-client #f))
 | 
			
		||||
	     ;; TODO: destroy switch if only one client left
 | 
			
		||||
	     ))
 | 
			
		||||
	     ;; destroy split if only one client left
 | 
			
		||||
	     (if (not (and first-client second-client))
 | 
			
		||||
		 (let ((repl (client:window (or first-client second-client))))
 | 
			
		||||
		   (mdisplay "destroying " wm ". with replacement " repl "\n")
 | 
			
		||||
		   (send (wm:out-channel wm)
 | 
			
		||||
			 (list 'destroy-wm wm repl))))))
 | 
			
		||||
	  
 | 
			
		||||
	  ((draw-client-window) #t)
 | 
			
		||||
	  
 | 
			
		||||
| 
						 | 
				
			
			@ -170,6 +176,7 @@
 | 
			
		|||
			  xc-sb-v-double-arrow))))
 | 
			
		||||
    (set-window-cursor! dpy window cursor)
 | 
			
		||||
    (spawn*
 | 
			
		||||
     (list 'split-resizer wm)
 | 
			
		||||
     (lambda (release)
 | 
			
		||||
       (call-with-event-channel
 | 
			
		||||
	dpy window (event-mask structure-notify
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue