-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EAF frame not in center in Mac OS #990
Comments
Same problem here. |
修改下列函数 (defun eaf-monitor-configuration-change (&rest _)
"EAF function to respond when detecting a window configuration change."
(when (and eaf--monitor-configuration-p
(eaf-epc-live-p eaf-epc-process))
(ignore-errors
(let (view-infos)
(dolist (frame (frame-list))
(dolist (window (window-list frame))
(with-current-buffer (window-buffer window)
(when (derived-mode-p 'eaf-mode)
;; When `eaf-fullscreen-p' is non-nil, and only the EAF window is present, use frame size
(if (and eaf-fullscreen-p (equal (length (cl-remove-if #'window-dedicated-p (window-list frame))) 1))
(push (format "%s:%s:%s:%s:%s:%s"
eaf--buffer-id
(eaf-get-emacs-xid frame)
0 0 (frame-pixel-width frame) (frame-pixel-height frame))
view-infos)
(let* ((window-allocation (eaf-get-window-allocation window))
(window-divider-right-padding (if window-divider-mode window-divider-default-right-width 0))
(window-divider-bottom-padding (if window-divider-mode window-divider-default-bottom-width 0))
(titlebar-height (eaf--get-titlebar-height))
(frame-coordinate (eaf--get-frame-coordinate))
(frame-x (car frame-coordinate))
(frame-y (cadr frame-coordinate))
(x (nth 0 window-allocation))
(y (nth 1 window-allocation))
(w (nth 2 window-allocation))
(h (nth 3 window-allocation)))
(push (format "%s:%s:%s:%s:%s:%s"
eaf--buffer-id
(eaf-get-emacs-xid frame)
(+ x frame-x)
(+ y titlebar-height frame-y)
(- w window-divider-right-padding)
(- h window-divider-bottom-padding))
view-infos)))))))
(eaf-call-async "update_views" (mapconcat #'identity view-infos ",")))))) 上面的函数去掉了对于x,y位置的调整, @manateelazycat 大佬看看怎么修改下代码,我非专业不知道其他地方、其他系统及环境有没有影响,就不提PR了。我测试了28.2和29.0.60两个版本的Emacs在Mac 13上都不需要进行x,y的调整。 |
@lhpfvs 大佬, 我没有 macOS, 你怎么看上一条建议? 还需要 eaf--buffer-x-position-adjust 和 eaf--buffer-y-position-adjust 吗? |
这两个不能去掉的吧,上面没问题只是因为刚好是最大化显示,如果没有最大化肯定是有问题的 |
28.2不做任何修改也有同样问题吗? |
你说的是对的,我一直使用最大化显示,所以没发现这个问题。 不做修改28.2是正常的,是在29上面不正常。 |
针对Emacs 29打个补丁? |
nsport的29有问题,调整窗口大小后frame-parameter没有更新,导致坐标不对,只有移动窗口才会更新。macport版本如果29发布了,应该是正常的。 |
@lhpfvs 已经支出了是 mac 构建不同包的问题, 而不是 emacs 的问题? |
官方Emacs本身就是有问题的,只要是改变窗口大小都会马上出错,但是移动一下窗口就能恢复正常。最大化窗口下只要试一试移动应该就可以了。 |
Describe the bug
EAF window is never in the center, it's always to the bottom right.
To Reproduce
I just installed eaf through spacemacs and this was my issue.
Expected behavior
EAF buffer should appear in the center of the screen.
Versions (please complete the following info):
Error logs
Screenshots
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: