Link Here
|
1 |
--- x.c.orig 2018-03-20 20:29:59 UTC |
1 |
--- x.c.orig 2019-02-09 12:50:41.000000000 +0100 |
2 |
+++ x.c |
2 |
+++ x.c 2019-02-11 14:02:22.026884000 +0100 |
3 |
@@ -53,6 +53,7 @@ static void clipcopy(const Arg *); |
3 |
@@ -53,6 +53,7 @@ |
4 |
static void clippaste(const Arg *); |
4 |
static void clippaste(const Arg *); |
5 |
static void numlock(const Arg *); |
5 |
static void numlock(const Arg *); |
6 |
static void selpaste(const Arg *); |
6 |
static void selpaste(const Arg *); |
Link Here
|
8 |
static void zoom(const Arg *); |
8 |
static void zoom(const Arg *); |
9 |
static void zoomabs(const Arg *); |
9 |
static void zoomabs(const Arg *); |
10 |
static void zoomreset(const Arg *); |
10 |
static void zoomreset(const Arg *); |
11 |
@@ -240,6 +241,8 @@ static char *opt_title = NULL; |
11 |
@@ -240,6 +241,8 @@ |
12 |
|
12 |
|
13 |
static int oldbutton = 3; /* button event on startup: 3 = release */ |
13 |
static int oldbutton = 3; /* button event on startup: 3 = release */ |
14 |
|
14 |
|
Link Here
|
17 |
void |
17 |
void |
18 |
clipcopy(const Arg *dummy) |
18 |
clipcopy(const Arg *dummy) |
19 |
{ |
19 |
{ |
20 |
@@ -279,6 +282,14 @@ numlock(const Arg *dummy) |
20 |
@@ -279,6 +282,14 @@ |
21 |
} |
21 |
} |
22 |
|
22 |
|
23 |
void |
23 |
void |
Link Here
|
32 |
zoom(const Arg *arg) |
32 |
zoom(const Arg *arg) |
33 |
{ |
33 |
{ |
34 |
Arg larg; |
34 |
Arg larg; |
35 |
@@ -700,6 +711,11 @@ sixd_to_16bit(int x) |
35 |
@@ -702,6 +713,11 @@ |
36 |
return x == 0 ? 0 : 0x3737 + 0x2828 * x; |
36 |
return x == 0 ? 0 : 0x3737 + 0x2828 * x; |
37 |
} |
37 |
} |
38 |
|
38 |
|
Link Here
|
44 |
int |
44 |
int |
45 |
xloadcolor(int i, const char *name, Color *ncolor) |
45 |
xloadcolor(int i, const char *name, Color *ncolor) |
46 |
{ |
46 |
{ |
47 |
@@ -718,7 +734,7 @@ xloadcolor(int i, const char *name, Colo |
47 |
@@ -720,7 +736,7 @@ |
48 |
return XftColorAllocValue(xw.dpy, xw.vis, |
48 |
return XftColorAllocValue(xw.dpy, xw.vis, |
49 |
xw.cmap, &color, ncolor); |
49 |
xw.cmap, &color, ncolor); |
50 |
} else |
50 |
} else |
Link Here
|
53 |
} |
53 |
} |
54 |
|
54 |
|
55 |
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); |
55 |
return XftColorAllocName(xw.dpy, xw.vis, xw.cmap, name, ncolor); |
56 |
@@ -731,7 +747,7 @@ xloadcols(void) |
56 |
@@ -737,14 +753,14 @@ |
57 |
static int loaded; |
57 |
for (cp = dc.col; cp < &dc.col[dc.collen]; ++cp) |
58 |
Color *cp; |
58 |
XftColorFree(xw.dpy, xw.vis, xw.cmap, cp); |
|
|
59 |
} else { |
60 |
- dc.collen = MAX(LEN(colorname), 256); |
61 |
+ dc.collen = MAX(LEN(colorname), LEN(altcolorname)); |
62 |
dc.col = xmalloc(dc.collen * sizeof(Color)); |
63 |
} |
59 |
|
64 |
|
60 |
- dc.collen = MAX(LEN(colorname), 256); |
|
|
61 |
+ dc.collen = MAX(LEN(colorname), LEN(altcolorname)); |
62 |
dc.col = xmalloc(dc.collen * sizeof(Color)); |
63 |
|
64 |
if (loaded) { |
65 |
@@ -741,8 +757,8 @@ xloadcols(void) |
66 |
|
67 |
for (i = 0; i < dc.collen; i++) |
65 |
for (i = 0; i < dc.collen; i++) |
68 |
if (!xloadcolor(i, NULL, &dc.col[i])) { |
66 |
if (!xloadcolor(i, NULL, &dc.col[i])) { |
69 |
- if (colorname[i]) |
67 |
- if (colorname[i]) |
70 |
- die("Could not allocate color '%s'\n", colorname[i]); |
68 |
- die("could not allocate color '%s'\n", colorname[i]); |
71 |
+ if (getcolorname(i)) |
69 |
+ if (getcolorname(i)) |
72 |
+ die("Could not allocate color '%s'\n", getcolorname(i)); |
70 |
+ die("could not allocate color '%s'\n", getcolorname(i)); |
73 |
else |
71 |
else |
74 |
die("Could not allocate color %d\n", i); |
72 |
die("could not allocate color %d\n", i); |
75 |
} |
73 |
} |
76 |
@@ -1079,13 +1095,13 @@ xinit(int cols, int rows) |
74 |
@@ -1082,13 +1098,13 @@ |
77 |
cursor = XCreateFontCursor(xw.dpy, mouseshape); |
75 |
cursor = XCreateFontCursor(xw.dpy, mouseshape); |
78 |
XDefineCursor(xw.dpy, xw.win, cursor); |
76 |
XDefineCursor(xw.dpy, xw.win, cursor); |
79 |
|
77 |
|
Link Here
|
89 |
xmousebg.red = 0x0000; |
87 |
xmousebg.red = 0x0000; |
90 |
xmousebg.green = 0x0000; |
88 |
xmousebg.green = 0x0000; |
91 |
xmousebg.blue = 0x0000; |
89 |
xmousebg.blue = 0x0000; |
92 |
@@ -1295,7 +1311,7 @@ xdrawglyphfontspecs(const XftGlyphFontSp |
90 |
@@ -1298,7 +1314,7 @@ |
93 |
|
91 |
|
94 |
/* Change basic system colors [0-7] to bright system colors [8-15] */ |
92 |
/* Change basic system colors [0-7] to bright system colors [8-15] */ |
95 |
if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) |
93 |
if ((base.mode & ATTR_BOLD_FAINT) == ATTR_BOLD && BETWEEN(base.fg, 0, 7)) |