~kris/suckless

st

907b79ca5c6e003adaf29df39aac2e1b1babb48c — TripleK2004 5 years ago 99704e1
Revert "patched dynamic cursor"

This reverts commit 3ded9ea4ddc139e17fb77a40480283c99f737ede.
4 files changed, 14 insertions(+), 29 deletions(-)

M config.def.h
M config.h
M config.mk
M x.c
M config.def.h => config.def.h +5 -5
@@ 5,7 5,7 @@
 *
 * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
 */
static char *font = "JetBrainsMono Nerd Font :pixelsize=17:antialias=true:autohint=true";
static char *font = "JetBrainsMono Nerd Font :pixelsize=15:antialias=true:autohint=true";
static char *font2[] = { "JetBrainsMono Nerd Font :pixelsize=15:antialias=true:autohint=true" };
static int borderpx = 0;



@@ 17,7 17,7 @@ static int borderpx = 0;
 * 4: value of shell in /etc/passwd
 * 5: value of shell in config.h
 */
static char *shell = "/bin/fish";
static char *shell = "/bin/sh";
char *utmp = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";



@@ 143,7 143,7 @@ static const char *colorname[] = {
 */
unsigned int defaultfg = 259;
unsigned int defaultbg = 258;
unsigned int defaultcs = 257;
unsigned int defaultcs = 256;
unsigned int defaultrcs = 257;

/*


@@ 249,8 249,8 @@ static Shortcut shortcuts[] = {
  { ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
  { ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
  { XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
  { ControlMask,        XK_equal,       zoom,           {.f = +1} },
  { ControlMask,	XK_minus,        zoom,           {.f = -1} },
  { MODKEY,              XK_comma,       zoom,           {.f = +1} },
  { MODKEY,              XK_period,        zoom,           {.f = -1} },
  { MODKEY,               XK_g,        zoomreset,      {.f =  0} },
  { ControlMask | ShiftMask,               XK_C,           clipcopy,       {.i =  0} },
  { ShiftMask,            XK_Insert,      clippaste,      {.i =  0} },

M config.h => config.h +5 -5
@@ 5,7 5,7 @@
 *
 * font: see http://freedesktop.org/software/fontconfig/fontconfig-user.html
 */
static char *font = "JetBrainsMono Nerd Font :pixelsize=17:antialias=true:autohint=true";
static char *font = "JetBrainsMono Nerd Font :pixelsize=15:antialias=true:autohint=true";
static char *font2[] = { "JetBrainsMono Nerd Font :pixelsize=15:antialias=true:autohint=true" };
static int borderpx = 0;



@@ 17,7 17,7 @@ static int borderpx = 0;
 * 4: value of shell in /etc/passwd
 * 5: value of shell in config.h
 */
static char *shell = "/bin/fish";
static char *shell = "/bin/sh";
char *utmp = NULL;
char *stty_args = "stty raw pass8 nl -echo -iexten -cstopb 38400";



@@ 143,7 143,7 @@ static const char *colorname[] = {
 */
unsigned int defaultfg = 259;
unsigned int defaultbg = 258;
unsigned int defaultcs = 257;
unsigned int defaultcs = 256;
unsigned int defaultrcs = 257;

/*


@@ 249,8 249,8 @@ static Shortcut shortcuts[] = {
  { ControlMask,          XK_Print,       toggleprinter,  {.i =  0} },
  { ShiftMask,            XK_Print,       printscreen,    {.i =  0} },
  { XK_ANY_MOD,           XK_Print,       printsel,       {.i =  0} },
  { ControlMask,        XK_equal,       zoom,           {.f = +1} },
  { ControlMask,	XK_minus,        zoom,           {.f = -1} },
  { MODKEY,              XK_comma,       zoom,           {.f = +1} },
  { MODKEY,              XK_period,        zoom,           {.f = -1} },
  { MODKEY,               XK_g,        zoomreset,      {.f =  0} },
  { ControlMask | ShiftMask,               XK_C,           clipcopy,       {.i =  0} },
  { ShiftMask,            XK_Insert,      clippaste,      {.i =  0} },

M config.mk => config.mk +1 -1
@@ 21,7 21,7 @@ INCS = -I$(X11INC) \
       `$(PKG_CONFIG) --cflags fontconfig` \
       `$(PKG_CONFIG) --cflags freetype2` \
       `$(PKG_CONFIG) --cflags harfbuzz`
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender \
LIBS = -L$(X11LIB) -lm -lrt -lX11 -lutil -lXft -lXrender\
       `$(PKG_CONFIG) --libs fontconfig` \
       `$(PKG_CONFIG) --libs freetype2` \
       `$(PKG_CONFIG) --libs harfbuzz`

M x.c => x.c +3 -18
@@ 697,7 697,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);


@@ 1612,7 1612,6 @@ void
xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int len)
{
	Color drawcol;
	XRenderColor colbg;

	/* remove the old cursor */
	if (selected(ox, oy))


@@ 1645,24 1644,10 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og, Line line, int le
			g.fg = defaultfg;
			g.bg = defaultrcs;
		} else {
			/** this is the main part of the dynamic cursor color patch */
			g.bg = g.fg;
			g.fg = defaultbg;
			g.bg = defaultcs;
		}

		/**
		 * and this is the second part of the dynamic cursor color patch.
		 * it handles the `drawcol` variable
		*/
		if (IS_TRUECOL(g.bg)) {
			colbg.alpha = 0xffff;
			colbg.red = TRUERED(g.bg);
			colbg.green = TRUEGREEN(g.bg);
			colbg.blue = TRUEBLUE(g.bg);
			XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &drawcol);
		} else {
			drawcol = dc.col[g.bg];
		}
		drawcol = dc.col[g.bg];
	}

	/* draw the new one */