You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
patches/st/st-anysize-simple-0.9-20230...

45 lines
1.4 KiB
Diff

From a6dd2f762b34b60f6df77acdd686fbedaf637412 Mon Sep 17 00:00:00 2001
From: Bakkeby <bakkeby@gmail.com>
Date: Mon, 12 Jun 2023 17:16:53 +0200
Subject: [PATCH] Anysize patch - simple version
The original anysize patch is fairly invasive and makes a lot of changes
to the st code base.
Out of these changes there are only two lines that allow for the window to
be resized to any size and that is setting the height and width increment
size hints to 1.
The rest of the changes are all related to centering the terminal content
within the window frame by distributing leftover pixels on the horizontal
and vertical borders.
This has the side effect of the terminal content wobbling when resizing it
diagonally.
This simple anysize version only applies the size hint changes which means
that leftover pixels will remain on the right and bottom sides of the
terminal.
---
x.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/x.c b/x.c
index aa09997..ea6e016 100644
--- a/x.c
+++ b/x.c
@@ -869,8 +869,8 @@ xhints(void)
sizeh->flags = PSize | PResizeInc | PBaseSize | PMinSize;
sizeh->height = win.h;
sizeh->width = win.w;
- sizeh->height_inc = win.ch;
- sizeh->width_inc = win.cw;
+ sizeh->height_inc = 1;
+ sizeh->width_inc = 1;
sizeh->base_height = 2 * borderpx;
sizeh->base_width = 2 * borderpx;
sizeh->min_height = win.ch + 2 * borderpx;
--
2.41.0