commit c359f7d5060bb3987aa9f7fdfe7902ad7818e40b
parent 0bb8c9d88c8ef2aaf7794835e6dbc13db174d309
Author: Eon S. Jeon <esjeon@hyunmu.am>
Date: Sun, 17 Feb 2019 13:44:51 +0900
rebase alpha patch for 0.8.2
The patch was based on a wrong commit, not 0.8.2.
Diffstat:
1 file changed, 8 insertions(+), 130 deletions(-)
diff --git a/st.suckless.org/patches/alpha/st-alpha-0.8.2.diff b/st.suckless.org/patches/alpha/st-alpha-0.8.2.diff
@@ -42,18 +42,6 @@ index 0cbb002..1d2f0e2 100644
`$(PKG_CONFIG) --libs fontconfig` \
`$(PKG_CONFIG) --libs freetype2`
-diff --git a/st.c b/st.c
-index cf8687e..b8e6077 100644
---- a/st.c
-+++ b/st.c
-@@ -2594,7 +2594,6 @@ draw(void)
- term.ocx, term.ocy, term.line[term.ocy][term.ocx]);
- term.ocx = cx, term.ocy = term.c.y;
- xfinishdraw();
-- xximspot(term.ocx, term.ocy);
- }
-
- void
diff --git a/st.h b/st.h
index 38c61c4..b7634ab 100644
--- a/st.h
@@ -63,17 +51,8 @@ index 38c61c4..b7634ab 100644
extern unsigned int defaultfg;
extern unsigned int defaultbg;
+extern float alpha;
-diff --git a/win.h b/win.h
-index a6ef1b9..31f327d 100644
---- a/win.h
-+++ b/win.h
-@@ -36,4 +36,3 @@ void xsetmode(int, unsigned int);
- void xsetpointermotion(int);
- void xsetsel(char *);
- int xstartdraw(void);
--void xximspot(int, int);
diff --git a/x.c b/x.c
-index 865dacc..588dec3 100644
+index 0422421..588dec3 100644
--- a/x.c
+++ b/x.c
@@ -98,6 +98,7 @@ typedef struct {
@@ -84,17 +63,7 @@ index 865dacc..588dec3 100644
int l, t; /* left and top offset */
int gm; /* geometry mask */
} XWindow;
-@@ -139,9 +140,6 @@ static void xdrawglyphfontspecs(const XftGlyphFontSpec *, Glyph, int, int, int);
- static void xdrawglyph(Glyph, int, int);
- static void xclear(int, int, int, int);
- static int xgeommasktogravity(int);
--static void ximopen(Display *);
--static void ximinstantiate(Display *, XPointer, XPointer);
--static void ximdestroy(XIM, XPointer, XPointer);
- static void xinit(int, int);
- static void cresize(int, int);
- static void xresize(int, int);
-@@ -232,6 +230,7 @@ static char *usedfont = NULL;
+@@ -229,6 +230,7 @@ static char *usedfont = NULL;
static double usedfontsize = 0;
static double defaultfontsize = 0;
@@ -102,7 +71,7 @@ index 865dacc..588dec3 100644
static char *opt_class = NULL;
static char **opt_cmd = NULL;
static char *opt_embed = NULL;
-@@ -691,7 +690,7 @@ xresize(int col, int row)
+@@ -688,7 +690,7 @@ xresize(int col, int row)
XFreePixmap(xw.dpy, xw.buf);
xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
@@ -111,7 +80,7 @@ index 865dacc..588dec3 100644
XftDrawChange(xw.draw, xw.buf);
xclear(0, 0, win.w, win.h);
-@@ -751,6 +750,13 @@ xloadcols(void)
+@@ -748,6 +750,13 @@ xloadcols(void)
else
die("could not allocate color %d\n", i);
}
@@ -125,51 +94,7 @@ index 865dacc..588dec3 100644
loaded = 1;
}
-@@ -999,43 +1005,6 @@ xunloadfonts(void)
- xunloadfont(&dc.ibfont);
- }
-
--void
--ximopen(Display *dpy)
--{
-- XIMCallback destroy = { .client_data = NULL, .callback = ximdestroy };
--
-- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
-- XSetLocaleModifiers("@im=local");
-- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
-- XSetLocaleModifiers("@im=");
-- if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL)
-- die("XOpenIM failed. Could not open input device.\n");
-- }
-- }
-- if (XSetIMValues(xw.xim, XNDestroyCallback, &destroy, NULL) != NULL)
-- die("XSetIMValues failed. Could not set input method value.\n");
-- xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing | XIMStatusNothing,
-- XNClientWindow, xw.win, XNFocusWindow, xw.win, NULL);
-- if (xw.xic == NULL)
-- die("XCreateIC failed. Could not obtain input method.\n");
--}
--
--void
--ximinstantiate(Display *dpy, XPointer client, XPointer call)
--{
-- ximopen(dpy);
-- XUnregisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL,
-- ximinstantiate, NULL);
--}
--
--void
--ximdestroy(XIM xim, XPointer client, XPointer call)
--{
-- xw.xim = NULL;
-- XRegisterIMInstantiateCallback(xw.dpy, NULL, NULL, NULL,
-- ximinstantiate, NULL);
--}
--
- void
- xinit(int cols, int rows)
- {
-@@ -1044,11 +1013,23 @@ xinit(int cols, int rows)
+@@ -1004,11 +1013,23 @@ xinit(int cols, int rows)
Window parent;
pid_t thispid = getpid();
XColor xmousefg, xmousebg;
@@ -194,7 +119,7 @@ index 865dacc..588dec3 100644
/* font */
if (!FcInit())
-@@ -1058,7 +1039,7 @@ xinit(int cols, int rows)
+@@ -1018,7 +1039,7 @@ xinit(int cols, int rows)
xloadfonts(usedfont, 0);
/* colors */
@@ -203,13 +128,7 @@ index 865dacc..588dec3 100644
xloadcols();
/* adjust fixed window geometry */
-@@ -1073,24 +1054,20 @@ xinit(int cols, int rows)
- xw.attrs.background_pixel = dc.col[defaultbg].pixel;
- xw.attrs.border_pixel = dc.col[defaultbg].pixel;
- xw.attrs.bit_gravity = NorthWestGravity;
-- xw.attrs.event_mask = FocusChangeMask | KeyPressMask | KeyReleaseMask
-+ xw.attrs.event_mask = FocusChangeMask | KeyPressMask
- | ExposureMask | VisibilityChangeMask | StructureNotifyMask
+@@ -1038,19 +1059,15 @@ xinit(int cols, int rows)
| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
xw.attrs.colormap = xw.cmap;
@@ -232,48 +151,7 @@ index 865dacc..588dec3 100644
XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
-@@ -1101,7 +1078,22 @@ xinit(int cols, int rows)
- xw.draw = XftDrawCreate(xw.dpy, xw.buf, xw.vis, xw.cmap);
-
- /* input methods */
-- ximopen(xw.dpy);
-+ if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
-+ XSetLocaleModifiers("@im=local");
-+ if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
-+ XSetLocaleModifiers("@im=");
-+ if ((xw.xim = XOpenIM(xw.dpy,
-+ NULL, NULL, NULL)) == NULL) {
-+ die("XOpenIM failed. Could not open input"
-+ " device.\n");
-+ }
-+ }
-+ }
-+ xw.xic = XCreateIC(xw.xim, XNInputStyle, XIMPreeditNothing
-+ | XIMStatusNothing, XNClientWindow, xw.win,
-+ XNFocusWindow, xw.win, NULL);
-+ if (xw.xic == NULL)
-+ die("XCreateIC failed. Could not obtain input method.\n");
-
- /* white cursor, black outline */
- cursor = XCreateFontCursor(xw.dpy, mouseshape);
-@@ -1579,16 +1571,6 @@ xfinishdraw(void)
- defaultfg : defaultbg].pixel);
- }
-
--void
--xximspot(int x, int y)
--{
-- XPoint spot = { borderpx + x * win.cw, borderpx + (y + 1) * win.ch };
-- XVaNestedList attr = XVaCreateNestedList(0, XNSpotLocation, &spot, NULL);
--
-- XSetICValues(xw.xic, XNPreeditAttributes, attr, NULL);
-- XFree(attr);
--}
--
- void
- expose(XEvent *ev)
- {
-@@ -1929,6 +1911,9 @@ main(int argc, char *argv[])
+@@ -1894,6 +1911,9 @@ main(int argc, char *argv[])
case 'a':
allowaltscreen = 0;
break;