Commit 82c028e0 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(x-create-frame-with-faces):

Specify frame arg to x-color-values and frame-parameters.
(set-face-background): Pass background-p arg to face-color-supported-p.
parent 5f8c8f00
...@@ -150,7 +150,7 @@ in that frame; otherwise change each frame." ...@@ -150,7 +150,7 @@ in that frame; otherwise change each frame."
;; For a specific frame, use gray stipple instead of gray color ;; For a specific frame, use gray stipple instead of gray color
;; if the display does not support a gray color. ;; if the display does not support a gray color.
(if (and frame (not (eq frame t)) (if (and frame (not (eq frame t))
(not (face-color-supported-p frame color))) (not (face-color-supported-p frame color t)))
(set-face-stipple face face-default-stipple frame) (set-face-stipple face face-default-stipple frame)
(if (null frame) (if (null frame)
(let ((frames (frame-list))) (let ((frames (frame-list)))
...@@ -1065,13 +1065,14 @@ selected frame." ...@@ -1065,13 +1065,14 @@ selected frame."
;; on this frame. ;; on this frame.
(let ((bg-resource (x-get-resource ".backgroundMode" (let ((bg-resource (x-get-resource ".backgroundMode"
"BackgroundMode")) "BackgroundMode"))
(params (frame-parameters)) (params (frame-parameters frame))
(bg-mode)) (bg-mode))
(setq bg-mode (setq bg-mode
(cond (bg-resource (intern (downcase bg-resource))) (cond (bg-resource (intern (downcase bg-resource)))
((< (apply '+ (x-color-values ((< (apply '+ (x-color-values
(cdr (assq 'background-color params)))) (cdr (assq 'background-color params))
(/ (apply '+ (x-color-values "white")) 3)) frame))
(/ (apply '+ (x-color-values "white" frame)) 3))
'dark) 'dark)
(t 'light))) (t 'light)))
(modify-frame-parameters frame (modify-frame-parameters frame
......
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