Skip to content
Snippets Groups Projects
Commit f9f611c8 authored by chiles's avatar chiles
Browse files

Modified EXT:OPEN-CLX-DISPLAY to set XLIB:DISPLAY-DEFAULT-SCREEN to the

screen specified by the user before returning the display.
parent 2f2d4341
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu. ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/clx-ext.lisp,v 1.4 1991/02/08 13:31:25 ram Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/clx-ext.lisp,v 1.5 1991/03/25 15:51:13 chiles Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -45,7 +45,9 @@ ...@@ -45,7 +45,9 @@
"Parses a display specification including display and screen numbers. "Parses a display specification including display and screen numbers.
This returns nil when there is no DISPLAY environment variable. If string This returns nil when there is no DISPLAY environment variable. If string
is non-nil, and any fields are missing in the specification, this signals an is non-nil, and any fields are missing in the specification, this signals an
error. This returns the display and screen objects." error. If you specify a screen, then this sets XLIB:DISPLAY-DEFAULT-SCREEN
to that screen since CLX initializes this form to the first of
XLIB:SCREEN-ROOTS. This returns the display and screen objects."
(when string (when string
(let* ((string (coerce string 'simple-string)) (let* ((string (coerce string 'simple-string))
(length (length string)) (length (length string))
...@@ -80,15 +82,16 @@ ...@@ -80,15 +82,16 @@
(parse-integer string :start start (parse-integer string :start start
:end second-dot))))))))))) :end second-dot)))))))))))
(let ((display (xlib:open-display host-name :display display-num))) (let ((display (xlib:open-display host-name :display display-num)))
(cond (screen-num (when screen-num
(let* ((screens (xlib:display-roots display)) (let* ((screens (xlib:display-roots display))
(num-screens (length screens))) (num-screens (length screens)))
(when (>= screen-num num-screens) (when (>= screen-num num-screens)
(xlib:close-display display) (xlib:close-display display)
(error "No such screen number (~D)." screen-num)) (error "No such screen number (~D)." screen-num))
(values display (elt screens screen-num)))) (setf (xlib:display-default-screen display)
(t (elt screens screen-num))))
(values display (xlib:display-default-screen display)))))))) (values display (xlib:display-default-screen display))))))
;;;; Font Path Manipulation ;;;; Font Path Manipulation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment