diff options
| -rw-r--r-- | lisp/faces.el | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/lisp/faces.el b/lisp/faces.el index 4a7d951aeac..2a817eba106 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1457,30 +1457,31 @@ examine the brightness for you." | |||
| 1457 | 1457 | ||
| 1458 | (defun frame-set-background-mode (frame) | 1458 | (defun frame-set-background-mode (frame) |
| 1459 | "Set up the `background-mode' and `display-type' frame parameters for FRAME." | 1459 | "Set up the `background-mode' and `display-type' frame parameters for FRAME." |
| 1460 | (let ((bg-resource (x-get-resource ".backgroundMode" | 1460 | (unless (memq (framep frame) '(t pc)) |
| 1461 | "BackgroundMode")) | 1461 | (let ((bg-resource (x-get-resource ".backgroundMode" |
| 1462 | (params (frame-parameters frame)) | 1462 | "BackgroundMode")) |
| 1463 | (bg-mode)) | 1463 | (params (frame-parameters frame)) |
| 1464 | (setq bg-mode | 1464 | (bg-mode)) |
| 1465 | (cond (frame-background-mode) | 1465 | (setq bg-mode |
| 1466 | (bg-resource (intern (downcase bg-resource))) | 1466 | (cond (frame-background-mode) |
| 1467 | ((< (apply '+ (x-color-values | 1467 | (bg-resource (intern (downcase bg-resource))) |
| 1468 | (cdr (assq 'background-color params)) | 1468 | ((< (apply '+ (x-color-values |
| 1469 | frame)) | 1469 | (cdr (assq 'background-color params)) |
| 1470 | ;; Just looking at the screen, | 1470 | frame)) |
| 1471 | ;; colors whose values add up to .6 of the white total | 1471 | ;; Just looking at the screen, |
| 1472 | ;; still look dark to me. | 1472 | ;; colors whose values add up to .6 of the white total |
| 1473 | (* (apply '+ (x-color-values "white" frame)) .6)) | 1473 | ;; still look dark to me. |
| 1474 | 'dark) | 1474 | (* (apply '+ (x-color-values "white" frame)) .6)) |
| 1475 | (t 'light))) | 1475 | 'dark) |
| 1476 | (modify-frame-parameters frame | 1476 | (t 'light))) |
| 1477 | (list (cons 'background-mode bg-mode) | 1477 | (modify-frame-parameters frame |
| 1478 | (cons 'display-type | 1478 | (list (cons 'background-mode bg-mode) |
| 1479 | (cond ((x-display-color-p frame) | 1479 | (cons 'display-type |
| 1480 | 'color) | 1480 | (cond ((x-display-color-p frame) |
| 1481 | ((x-display-grayscale-p frame) | 1481 | 'color) |
| 1482 | 'grayscale) | 1482 | ((x-display-grayscale-p frame) |
| 1483 | (t 'mono))))))) | 1483 | 'grayscale) |
| 1484 | (t 'mono)))))))) | ||
| 1484 | 1485 | ||
| 1485 | ;; Update a frame's faces when we change its default font. | 1486 | ;; Update a frame's faces when we change its default font. |
| 1486 | (defun frame-update-faces (frame) nil) | 1487 | (defun frame-update-faces (frame) nil) |