help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Frame shifted upwards upon changing font size


From: Gregory Heytings
Subject: Re: Frame shifted upwards upon changing font size
Date: Tue, 13 Sep 2022 13:53:00 +0000


(defun frame-center (&optional frame display)
  (interactive)
  (set-frame-position
   frame
   (/ (- (display-pixel-width display) (frame-pixel-width frame)) 2)
   (/ (- (display-pixel-height display) (frame-pixel-height frame)) 2)))

I have different monitors with different sizes, and the function is transferring the frame to a different monitor.


In that case you need to use display-monitor-attributes-list to get the size of the appropriate monitor.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]