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

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

bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the pro


From: martin rudalics
Subject: bug#21480: 25.0.50; Frame width gets set to 16 pixels wider than the provided width in the args
Date: Tue, 15 Sep 2015 10:27:48 +0200

> - I save the frame width using `frame-pixel-width' to a defvar.
> - I then set the frame size using `set-frame-size' with that defvar as one
> of the args
> - I notice that the frame had got wider! When I do a readback using
> `frame-pixel-width', it is exactly 16 pixels wider than expected.

‘set-frame-size’ expects a "text width" as argument.  Hence the
following

(setq frame-resize-pixelwise t)
(let ((width (frame-pixel-width)))
  (set-frame-width nil (+ width 20) nil t)
  (sit-for 2)
  (set-frame-width nil width nil t)
  (sit-for 2)
  (message "%s" (cons width (frame-pixel-width))))

is wrong.  The difference you see should be the sum of a scroll bar
width and the width of the fringes.  This

(setq frame-resize-pixelwise t)
(let ((width (frame-text-width)))
  (set-frame-width nil (+ width 20) nil t)
  (sit-for 2)
  (set-frame-width nil width nil t)
  (message "%s" (cons width (frame-text-width))))

should do what you want.

martin






reply via email to

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