Commit e8a2b2da authored by Chong Yidong's avatar Chong Yidong
Browse files

* faces.el (x-handle-named-frame-geometry): Ensure that we have

opened an X connection before calling x-get-resource (Bug#3194).
parent 4e23bedb
2009-06-27 Chong Yidong <cyd@stupidchicken.com>
* faces.el (x-handle-named-frame-geometry): Ensure that we have
opened an X connection before calling x-get-resource (Bug#3194).
* play/doctor.el: Remove reference to obsolete website.
(make-doctor-variables): Correct grammar mistake (Bug#2633).
......
......@@ -1921,28 +1921,25 @@ according to the `background-mode' and `display-type' frame parameters."
(defun x-handle-named-frame-geometry (parameters)
"Add geometry parameters for a named frame to parameter list PARAMETERS.
Value is the new parameter list."
(let* ((name (or (cdr (assq 'name parameters))
(cdr (assq 'name default-frame-alist))))
(x-resource-name name)
(res-geometry (when name
;; FIXME: x-get-resource fails if the X
;; connection is not open, e.g. if we call
;; make-frame-on-display. We should detect
;; this case here, and open the connection.
;; (Bug#3194).
(ignore-errors
(x-get-resource "geometry" "Geometry")))))
(when res-geometry
(let ((parsed (x-parse-geometry res-geometry)))
;; If the resource specifies a position, call the position
;; and size "user-specified".
(when (or (assq 'top parsed)
(assq 'left parsed))
(setq parsed (append '((user-position . t) (user-size . t)) parsed)))
;; Put the geometry parameters at the end. Copy
;; default-frame-alist so that they go after it.
(setq parameters (append parameters default-frame-alist parsed))))
parameters))
;; Note that `x-resource-name' has a global meaning.
(let ((x-resource-name (or (cdr (assq 'name parameters))
(cdr (assq 'name default-frame-alist)))))
(when x-resource-name
;; Before checking X resources, we must have an X connection.
(or (window-system)
(x-display-list)
(x-open-connection (or (cdr (assq 'display parameters))
x-display-name)))
(let (res-geometry parsed)
(and (setq res-geometry (x-get-resource "geometry" "Geometry"))
(setq parsed (x-parse-geometry res-geometry))
(setq parameters
(append parameters default-frame-alist parsed
;; If the resource specifies a position,
;; take note of that.
(if (or (assq 'top parsed) (assq 'left parsed))
'((user-position . t) (user-size . t)))))))))
parameters)
(defun x-handle-reverse-video (frame parameters)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment