Skip to content

Commit 80965f6

Browse files
authored
Merge pull request #39 from HyunggyuJang/restore-to-default-frame/window-settings
Fix hard coded frame border, window fringe restoration process
2 parents f508599 + 9ac3ffa commit 80965f6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

centered-window.el

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ by this function."
180180
(remove-hook 'window-configuration-change-hook #'cwm-center-windows)
181181
(remove-hook 'window-size-change-functions #'cwm-center-windows-frame)
182182
(cwm-center-windows)
183-
(set-frame-parameter nil 'internal-border-width 0)
183+
(set-frame-parameter
184+
nil
185+
'internal-border-width
186+
(or (alist-get 'internal-border-width default-frame-alist)
187+
0))
184188
(cwm-unbind-fringe-mouse-events))
185189

186190
(defun cwm-center-windows-frame (frame)
@@ -226,8 +230,8 @@ by this function."
226230
0))
227231
0))
228232
(ratio (/ (* n cwm-left-fringe-ratio) 100))
229-
(left-width (* pixel (if (> n 0) (+ n ratio) n)))
230-
(right-width (* pixel (if (> n 0) (- n ratio) n))))
233+
(left-width (and mode-active-p (* pixel (if (> n 0) (+ n ratio) n))))
234+
(right-width (and mode-active-p (* pixel (if (> n 0) (- n ratio) n)))))
231235
`(,left-width . ,right-width)))
232236

233237
(defun cwm-toggle-bind-fringe-mouse-events (&optional bind direction-command-alist)

0 commit comments

Comments
 (0)