st

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 907b79ca5c6e003adaf29df39aac2e1b1babb48c
parent 99704e1b41d4c5a74365b0ff0e398f4bd898da74
Author: TripleK2004 <kowkeerthankumar@gmail.com>
Date:   Tue,  8 Jun 2021 23:01:34 +0530

Revert "patched dynamic cursor"

This reverts commit 3ded9ea4ddc139e17fb77a40480283c99f737ede.

Diffstat:
Mconfig.def.h | 10+++++-----
Mconfig.h | 10+++++-----
Mconfig.mk | 2+-
Mx.c | 21+++------------------
4 files changed, 14 insertions(+), 29 deletions(-)

diff --git a/config.def.h b/config.def.h @@ -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} }, diff --git a/config.h b/config.h @@ -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} }, diff --git a/config.mk b/config.mk @@ -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` diff --git a/x.c b/x.c @@ -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 */