Fix lag when opening new frames
This commit is contained in:
parent
e79a0f867d
commit
9a0b8c6d04
27
init.el
27
init.el
|
@ -1,18 +1,29 @@
|
||||||
;;;; Appearance
|
;;;; Appearance
|
||||||
|
|
||||||
(defun apply-appearance ()
|
(defun apply-appearance-first-frame ()
|
||||||
|
(message "Set first frame appearance")
|
||||||
;; Set theme
|
;; Set theme
|
||||||
(load-theme 'my-theme +1)
|
(load-theme 'my-theme +1))
|
||||||
;; Use JBMono
|
|
||||||
(set-frame-font "-JB-JetBrainsMonoNL Nerd Font-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1" nil t)
|
|
||||||
;; Hide GTK scroll bar
|
|
||||||
(toggle-scroll-bar -1))
|
|
||||||
|
|
||||||
(apply-appearance)
|
(defun apply-appearance-per-frame ()
|
||||||
|
(message "Set per frame appearance")
|
||||||
|
;; Hide scroll bar
|
||||||
|
(toggle-scroll-bar -1)
|
||||||
|
;; Use JBMono
|
||||||
|
(set-frame-font "-JB-JetBrainsMonoNL Nerd Font-normal-normal-normal-*-18-*-*-*-m-0-iso10646-1" nil t))
|
||||||
|
|
||||||
|
(apply-appearance-first-frame)
|
||||||
|
(apply-appearance-per-frame)
|
||||||
|
|
||||||
|
(setq seen-first-frame nil)
|
||||||
(add-hook 'after-make-frame-functions
|
(add-hook 'after-make-frame-functions
|
||||||
(lambda (frame)
|
(lambda (frame)
|
||||||
(with-selected-frame frame
|
(with-selected-frame frame
|
||||||
(apply-appearance))))
|
(apply-appearance-per-frame)
|
||||||
|
(if (not seen-first-frame)
|
||||||
|
(progn
|
||||||
|
(setq seen-first-frame 1)
|
||||||
|
(apply-appearance-first-frame))))))
|
||||||
|
|
||||||
;; Hide ribbon, menu bar
|
;; Hide ribbon, menu bar
|
||||||
(menu-bar-mode -1)
|
(menu-bar-mode -1)
|
||||||
|
|
|
@ -10,8 +10,12 @@
|
||||||
`(:background ,(nth type (plist-get args :bg)))))
|
`(:background ,(nth type (plist-get args :bg)))))
|
||||||
(if (plist-member args :italic) '(:slant italic))))))
|
(if (plist-member args :italic) '(:slant italic))))))
|
||||||
`(,face
|
`(,face
|
||||||
,`(,(funcall build-face '((min-colors 256)) 0 args)
|
,`(
|
||||||
,(funcall build-face '((min-colors 8)) 1 args))))))
|
,(funcall build-face '((min-colors 0)) 0 args)
|
||||||
|
;;,(funcall build-face '((min-colors 256)) 0 args)
|
||||||
|
;;,(funcall build-face '((min-colors 8)) 1 args)
|
||||||
|
)
|
||||||
|
))))
|
||||||
(color-join (lambda (list)
|
(color-join (lambda (list)
|
||||||
(format "#%02x%02x%02x"
|
(format "#%02x%02x%02x"
|
||||||
(ash (nth 0 list) -8)
|
(ash (nth 0 list) -8)
|
||||||
|
|
Loading…
Reference in a new issue