all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tiling window managers and alignment of frames
@ 2024-02-12  3:17 Gergely Riskó
  2024-02-15  8:30 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Gergely Riskó @ 2024-02-12  3:17 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: tiling window managers and alignment of frames
  2024-02-12  3:17 tiling window managers and alignment of frames Gergely Riskó
@ 2024-02-15  8:30 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2024-02-15  8:30 UTC (permalink / raw)
  To: Gergely Riskó, Po Lu; +Cc: emacs-devel

> From: Gergely Riskó <gergely.risko@gmail.com>
> 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?

Po Lu, any comments or suggestions?



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-02-15  8:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-12  3:17 tiling window managers and alignment of frames Gergely Riskó
2024-02-15  8:30 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.