1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-23 07:19:15 +00:00

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

opened an X connection before calling x-get-resource (Bug#3194).
This commit is contained in:
Chong Yidong 2009-06-27 20:44:03 +00:00
parent 4e23bedbfa
commit e8a2b2da68
2 changed files with 22 additions and 22 deletions

View File

@ -1,5 +1,8 @@
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).

View File

@ -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)