- create-simple-window now uses a border-width of 0.
- fixed a bug in query-tree. - added auxiliary functions for query-tree: window-root, window-parent and window-children. - added auxiliary functions for map-state: window-mapped?, window-viewable? and window-unviewable?
This commit is contained in:
		
							parent
							
								
									546f0d828f
								
							
						
					
					
						commit
						8b739b7124
					
				| 
						 | 
				
			
			@ -45,7 +45,7 @@
 | 
			
		|||
 | 
			
		||||
(define (create-simple-window parent width height 
 | 
			
		||||
			      set-window-attribute-alist)
 | 
			
		||||
  (create-window parent 0 0 width height 1
 | 
			
		||||
  (create-window parent 0 0 width height 0
 | 
			
		||||
		 'copy-from-parent 'copy-from-parent 'copy-from-parent
 | 
			
		||||
		 set-window-attribute-alist))
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -182,6 +182,15 @@
 | 
			
		|||
(define window-override-redirect 
 | 
			
		||||
  (make-win-attr-getter (window-attribute override-redirect)))
 | 
			
		||||
 | 
			
		||||
;; some functions for easier access to the attributes
 | 
			
		||||
 | 
			
		||||
(define (window-mapped? window)
 | 
			
		||||
  (not (eq? (map-state is-unmapped) (window-map-state window))))
 | 
			
		||||
(define (window-viewable? window)
 | 
			
		||||
  (eq? (map-state is-viewable) (window-map-state window)))
 | 
			
		||||
(define (window-unviewable? window)
 | 
			
		||||
  (eq? (map-state is-unviewable) (window-map-state window)))
 | 
			
		||||
 | 
			
		||||
;; The map-window function maps the window and all of its subwindows
 | 
			
		||||
;; that have had map requests. See XMapWindow.
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -284,16 +293,35 @@
 | 
			
		|||
  (let* ((display (window-display window))
 | 
			
		||||
	 (res (%query-tree (window-Xwindow window)
 | 
			
		||||
			   (display-Xdisplay display))))
 | 
			
		||||
    (list
 | 
			
		||||
     (make-window (vector-ref res 0) display #f)
 | 
			
		||||
     (make-window (vector-ref res 1) display #f)
 | 
			
		||||
     (vector->list (vector-map! (lambda (Xwindow)
 | 
			
		||||
				  (make-window Xwindow display #f))
 | 
			
		||||
				(vector-ref res 2))))))
 | 
			
		||||
    (if res
 | 
			
		||||
	(list
 | 
			
		||||
	 (make-window (vector-ref res 0) display #f)
 | 
			
		||||
	 (make-window (vector-ref res 1) display #f)
 | 
			
		||||
	 (vector->list (vector-map! (lambda (Xwindow)
 | 
			
		||||
				      (make-window Xwindow display #f))
 | 
			
		||||
				    (vector-ref res 2))))
 | 
			
		||||
	res)))
 | 
			
		||||
 | 
			
		||||
(import-lambda-definition %query-tree (Xwindow Xdisplay)
 | 
			
		||||
  "scx_Query_Tree")
 | 
			
		||||
 | 
			
		||||
(define (window-root window)
 | 
			
		||||
  (let ((t (query-tree window)))
 | 
			
		||||
    (and t (car t))))
 | 
			
		||||
 | 
			
		||||
(define (window-parent window)
 | 
			
		||||
  (let ((t (query-tree window)))
 | 
			
		||||
    (and t (cadr t))))
 | 
			
		||||
 | 
			
		||||
(define (window-children window)
 | 
			
		||||
  (let ((t (query-tree window)))
 | 
			
		||||
    (and t (caddr t))))
 | 
			
		||||
 | 
			
		||||
(define (window-exists? window) ;; maybe this should be done a little
 | 
			
		||||
				;; bit more clever
 | 
			
		||||
  (if (query-tree window)
 | 
			
		||||
      #t #f))
 | 
			
		||||
 | 
			
		||||
;; translate-coordinates takes the x and y coordinates relative to the
 | 
			
		||||
;; source window's origin and returns a list of three elements: the x
 | 
			
		||||
;; and y coordinates relative to the destination window's origin. If
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue