# st

Unnamed repository; edit this file 'description' to name the repository.

| Log | Files | Refs | README | LICENSE

    commit d9920e6a41e748da49bac5cc1a430a5cac3dc66e
    parent 81da44c5fcf4324cc76ddeeb445ab8e6d8561a1d
    Author: c0dev0id <sh+github@codevoid.de>
    Date:   Sun, 19 Sep 2021 20:30:34 +0200

    sdk-cleanup

    Diffstat:
    MMakefile | 2+-
    Mconfig.def.h | 10++--------
    Mconfig.h | 12+++---------
    Mx.c | 44++++----------------------------------------

    4 files changed, 10 insertions(+), 58 deletions(-)
    diff --git a/Makefile b/Makefile
    @@ -48,7 +48,7 @@ install: st
     	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
     	sed "s/VERSION/$(VERSION)/g" < st.1 > $(DESTDIR)$(MANPREFIX)/man1/st.1
     	chmod 644 $(DESTDIR)$(MANPREFIX)/man1/st.1
    -	@tic -xs st.info
    +	tic -xs st.info
     	@echo Please see the README file regarding the terminfo entry of st.

     uninstall:
    diff --git a/config.def.h b/config.def.h
    @@ -92,7 +92,7 @@ const int boxdraw_braille = 0;
     static int bellvolume = 0;

     /* default TERM value */
    -char *termname = "st-git-256color";
    +char *termname = "st-256color";

     /*
      * spaces per tab
    @@ -160,12 +160,6 @@ static unsigned int defaultrcs = 257;
     static unsigned int cursorshape = 2;

     /*
    - * Whether to use pixel geometry or cell geometry
    - */
    -
    -static Geometry geometry = CellGeometry;
    -
    -/*
      * Default columns and rows numbers
      */

    @@ -233,7 +227,7 @@ static Shortcut shortcuts[] = {
     	{ ShiftMask,            XK_Page_Up,     kscrollup,      {.i = -1} },
     	{ ShiftMask,            XK_Page_Down,   kscrolldown,    {.i = -1} },
     	{ ShiftMask,            XK_l,           copyurl,        {.i =  0} },
    -	{ ShiftMask,            XK_o,           opencopied,     {.v = "luakit"} },
    +	{ ShiftMask,            XK_o,           opencopied,     {.v = "xdg-open"} },
     };

     /*
    diff --git a/config.h b/config.h
    @@ -6,8 +6,8 @@
      * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
      */
     static char *font = "Cousine:size=12";
    -
     static int borderpx = 2;
    +
     /*
      * What program is execed by st depends of these precedence rules:
      * 1: program passed with -e
    @@ -53,8 +53,8 @@ int allowwindowops = 0;
      * near minlatency, but it waits longer for slow updates to avoid partial draw.
      * low minlatency will tear/flicker more, as it can "detect" idle too early.
      */
    -static double minlatency = 6;
    -static double maxlatency = 80;
    +static double minlatency = 8;
    +static double maxlatency = 33;

     /*
      * Synchronized-Update timeout in ms
    @@ -161,12 +161,6 @@ static unsigned int defaultrcs = 257;
     static unsigned int cursorshape = 2;

     /*
    - * Whether to use pixel geometry or cell geometry
    - */
    -
    -static Geometry geometry = AnySize;
    -
    -/*
      * Default columns and rows numbers
      */

    diff --git a/x.c b/x.c
    @@ -45,12 +45,6 @@ typedef struct {
     	signed char appcursor; /* application cursor */
     } Key;

    -typedef enum {
    -	PixelGeometry,
    -	CellGeometry,
    -	AnySize
    -} Geometry;
    -
     /* X modifiers */
     #define XK_ANY_MOD    UINT_MAX
     #define XK_NO_MOD     0
    @@ -1141,20 +1135,8 @@ xinit(int w, int h)
     	xloadcols();

     	/* adjust fixed window geometry */
    -	switch (geometry) {
    -	case CellGeometry:
    -		win.w = 2 * borderpx + w * win.cw;
    -		win.h = 2 * borderpx + h * win.ch;
    -		break;
    -	case PixelGeometry:
    -		win.w = w;
    -		win.h = h;
    -		break;
    -	case AnySize:
    -		win.w = 2 * win.hborderpx + 2 * borderpx + cols * win.cw;
    -		win.h = 2 * win.vborderpx + 2 * borderpx + rows * win.ch;
    -		break;
    -	}
    +	win.w = 2 * win.hborderpx + 2 * borderpx + cols * win.cw;
    +	win.h = 2 * win.vborderpx + 2 * borderpx + rows * win.ch;
     	if (xw.gm & XNegative)
     		xw.l += DisplayWidth(xw.dpy, xw.scr) - win.w - 2;
     	if (xw.gm & YNegative)
    @@ -1951,7 +1933,7 @@ run(void)
     		}
     	} while (ev.type != MapNotify);

    -	ttyresize(0,0);
    +	cresize(w, h);
     	ttyfd = ttynew(opt_line, shell, opt_io, opt_cmd);
     	cresize(w, h);

    @@ -2079,12 +2061,6 @@ main(int argc, char *argv[])
     	case 'g':
     		xw.gm = XParseGeometry(EARGF(usage()),
     				&xw.l, &xw.t, &cols, &rows);
    -		geometry = CellGeometry;
    -		break;
    -	case 'G':
    -		xw.gm = XParseGeometry(EARGF(usage()),
    -				&xw.l, &xw.t, &width, &height);
    -		geometry = PixelGeometry;
     		break;
     	case 'i':
     		xw.isfixed = 1;
    @@ -2121,22 +2097,10 @@ run:

     	setlocale(LC_CTYPE, "");
     	XSetLocaleModifiers("");
    -	switch (geometry) {
    -	case CellGeometry:
    -		xinit(cols, rows);
    -		break;
    -	case AnySize:
    -		xinit(cols, rows);
    -		break;
    -	case PixelGeometry:
    -		xinit(width, height);
    -		cols = (win.w - 2 * borderpx) / win.cw;
    -		rows = (win.h - 2 * borderpx) / win.ch;
    -		break;
    -	}
     	cols = MAX(cols, 1);
     	rows = MAX(rows, 1);
     	tnew(cols, rows);
    +	xinit(cols, rows);
     	xsetenv();
     	selinit();
     	run();