~kris/suckless

st

cd3b00c38e589e30246b02fd0913853951ce4f0b — siduck76 5 years ago 0e08f0e
live-reload patch
2 files changed, 24 insertions(+), 1 deletions(-)

M x.c
M x.c.orig
M x.c => x.c +23 -0
@@ 2155,6 2155,28 @@ usage(void)
	    " [stty_args ...]\n", argv0, argv0);
}

void
reload(int sig)
{
	config_init();

	/* colors, fonts */
	xloadcols();
	xunloadfonts();
	usedfont = (opt_font == NULL)? font : opt_font;
	xloadfonts(usedfont, 0);

	/* pretend the window just got resized */
	cresize(win.w, win.h);

	redraw();

	/* triggers re-render if we're visible. */
	ttywrite("\033[O", 3, 1);

	signal(SIGUSR1, reload);
}

int
main(int argc, char *argv[])
{


@@ 2225,6 2247,7 @@ run:
	config_init();
	cols = MAX(cols, 1);
	rows = MAX(rows, 1);
	signal(SIGUSR1, reload);
	tnew(cols, rows);
	xinit(cols, rows);
	xsetenv();

M x.c.orig => x.c.orig +1 -1
@@ 695,7 695,7 @@ brelease(XEvent *e)
		return;
	}

	if (e->xbutton.button == Button2)
	if (e->xbutton.button == Button3)
		selpaste(NULL);
	else if (e->xbutton.button == Button1)
		mousesel(e, 1);