[wiki] [sites] rebase alpha patch for 0.8.2 || Eon S. Jeon

From: <git_AT_suckless.org>
Date: Sun, 17 Feb 2019 05:49:23 +0100

commit c359f7d5060bb3987aa9f7fdfe7902ad7818e40b
Author: Eon S. Jeon <esjeon_AT_hyunmu.am>
Date: Sun Feb 17 13:44:51 2019 +0900

    rebase alpha patch for 0.8.2
    
    The patch was based on a wrong commit, not 0.8.2.

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
index b73852b7..dad6615f 100644
--- a/st.suckless.org/patches/alpha/st-alpha-0.8.2.diff
+++ b/st.suckless.org/patches/alpha/st-alpha-0.8.2.diff
_AT_@ -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
-_AT_@ -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
_AT_@ -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
-_AT_@ -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
 _AT_@ -98,6 +98,7 @@ typedef struct {
_AT_@ -84,17 +63,7 @@ index 865dacc..588dec3 100644
          int l, t; /* left and top offset */
          int gm; /* geometry mask */
  } XWindow;
-_AT_@ -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);
-_AT_@ -232,6 +230,7 @@ static char *usedfont = NULL;
+_AT_@ -229,6 +230,7 @@ static char *usedfont = NULL;
  static double usedfontsize = 0;
  static double defaultfontsize = 0;
  
_AT_@ -102,7 +71,7 @@ index 865dacc..588dec3 100644
  static char *opt_class = NULL;
  static char **opt_cmd = NULL;
  static char *opt_embed = NULL;
-_AT_@ -691,7 +690,7 @@ xresize(int col, int row)
+_AT_@ -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,
_AT_@ -111,7 +80,7 @@ index 865dacc..588dec3 100644
          XftDrawChange(xw.draw, xw.buf);
          xclear(0, 0, win.w, win.h);
  
-_AT_@ -751,6 +750,13 @@ xloadcols(void)
+_AT_@ -748,6 +750,13 @@ xloadcols(void)
                          else
                                  die("could not allocate color %d
", i);
                  }
_AT_@ -125,51 +94,7 @@ index 865dacc..588dec3 100644
          loaded = 1;
  }
  
-_AT_@ -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("_AT_im=local");
--		if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
--			XSetLocaleModifiers("_AT_im=");
--			if ((xw.xim = XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL)
--				die("XOpenIM failed. Could not open input device.
");
--		}
--	}
--	if (XSetIMValues(xw.xim, XNDestroyCallback, &destroy, NULL) != NULL)
--		die("XSetIMValues failed. Could not set input method value.
");
--	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.
");
--}
--
--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)
- {
-_AT_@ -1044,11 +1013,23 @@ xinit(int cols, int rows)
+_AT_@ -1004,11 +1013,23 @@ xinit(int cols, int rows)
  	Window parent;
  	pid_t thispid = getpid();
  	XColor xmousefg, xmousebg;
_AT_@ -194,7 +119,7 @@ index 865dacc..588dec3 100644
  
  	/* font */
  	if (!FcInit())
-_AT_@ -1058,7 +1039,7 @@ xinit(int cols, int rows)
+_AT_@ -1018,7 +1039,7 @@ xinit(int cols, int rows)
  	xloadfonts(usedfont, 0);
  
  	/* colors */
_AT_@ -203,13 +128,7 @@ index 865dacc..588dec3 100644
  	xloadcols();
  
  	/* adjust fixed window geometry */
-_AT_@ -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
+_AT_@ -1038,19 +1059,15 @@ xinit(int cols, int rows)
  		| ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
  	xw.attrs.colormap = xw.cmap;
  
_AT_@ -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);
  
-_AT_@ -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("_AT_im=local");
-+		if ((xw.xim =  XOpenIM(xw.dpy, NULL, NULL, NULL)) == NULL) {
-+			XSetLocaleModifiers("_AT_im=");
-+			if ((xw.xim = XOpenIM(xw.dpy,
-+					NULL, NULL, NULL)) == NULL) {
-+				die("XOpenIM failed. Could not open input"
-+					" device.
");
-+			}
-+		}
-+	}
-+	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.
");
- 
- 	/* white cursor, black outline */
- 	cursor = XCreateFontCursor(xw.dpy, mouseshape);
-_AT_@ -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)
- {
-_AT_@ -1929,6 +1911,9 @@ main(int argc, char *argv[])
+_AT_@ -1894,6 +1911,9 @@ main(int argc, char *argv[])
  	case 'a':
  		allowaltscreen = 0;
  		break;
Received on Sun Feb 17 2019 - 05:49:23 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 17 2019 - 06:00:31 CET