emacs-devel
[Top][All Lists]
Advanced

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

tiling window managers and alignment of frames


From: Gergely Riskó
Subject: tiling window managers and alignment of frames
Date: Mon, 12 Feb 2024 04:17:18 +0100

Hi,

I'm using GNU Emacs 29.1 lucid (X toolkit).

In my setup, I only use fixed height fonts and all windows use the
same font size, modeline has no extra line-space and internal frame
border is set to 0.  Therefore if the height of a frame is divisible
by (frame-char-height), the display is always guaranteed to be pixel
perfect: no lines in any of the buffers with vertically half displayed
lines, which looks nice.

Emacs has good configurability to keep this setup going: by default
resize of frames is happening by (frame-char-height), and that
behavior is quite nice, if I resize Emacs frames with a WM, the size
of the frame keeps the divisibility by (frame-char-height).

Now, the problem is, that I'm using a tiling window manager (i3), and
that ignores the size hints from Emacs when in tiling mode and just
forces an arbitrary height.  And as a response to this, Emacs just
assigns the extra pixels in the middle of the layout to one of the
windows.

I'd like to have a variable (e.g. frame-resize-force-char-height) that
tells Emacs that if all of the following is true:

  - frame-resize-force-char-height == t
  - && frame-resize-pixelwise == nil
  - && rem != 0
    (where rem := (frame-pixel-height) % (frame-char-height))

then, the display engine should:

  - skip rem number of pixels right on top (or bottom) of the frame,
  - and just use the background frame color for this vertical skip.

This is the behavior of xterm and urxvt (with the extra pixel lines
being allocated to the bottom of the x11 window), and I'd like to have
the same for my Lucid Emacs.

Is this possible or already implemented and did I just miss it?  I
tried to do my research for a couple of hours, but didn't find it.
Would it be difficult to add this to redisplay?  Is there any other
workaround I could try to ensure that my windows never have halved
displayed lines (until I keep my fonts all the same height in every
window)?

Of course, my window manager could be intelligent enough to do this on
the tiling side, but I don't think it would be easy to convince them,
as they are pretty happy with the status of i3 as it is.

Any ideas?

Cheers,
Gergely



reply via email to

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