suckless st 0.9.2 alpha补丁无法正常工作

suckless st 0.9.2 alpha补丁无法正常工作

打完补丁发现x.c没有成功

x.c.rej如下

--- x.c
+++ x.c
@@ -1175,19 +1198,15 @@ xinit(int cols, int rows)
                | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask;
        xw.attrs.colormap = xw.cmap;

-       if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
-               parent = XRootWindow(xw.dpy, xw.scr);
        xw.win = XCreateWindow(xw.dpy, parent, xw.l, xw.t,
-                       win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
+                       win.w, win.h, 0, xw.depth, InputOutput,
                        xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
                        | CWEventMask | CWColormap, &xw.attrs);

        memset(&gcvalues, 0, sizeof(gcvalues));
        gcvalues.graphics_exposures = False;
-       dc.gc = XCreateGC(xw.dpy, parent, GCGraphicsExposures,
-                       &gcvalues);
-       xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
-                       DefaultDepth(xw.dpy, xw.scr));
+       xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h, xw.depth);
+       dc.gc = XCreateGC(xw.dpy, xw.buf, GCGraphicsExposures, &gcvalues);
        XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
        XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);

打开x.c做出如下修订

@@ -1169,10 +1192,8 @@ xinit(int cols, int rows)
 	xw.attrs.colormap = xw.cmap;
 
 	root = XRootWindow(xw.dpy, xw.scr);  //保留
-	if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0))))
-		parent = root;
 	xw.win = XCreateWindow(xw.dpy, root, xw.l, xw.t,
-			win.w, win.h, 0, XDefaultDepth(xw.dpy, xw.scr), InputOutput,
+			win.w, win.h, 0, xw.depth, InputOutput,
 			xw.vis, CWBackPixel | CWBorderPixel | CWBitGravity
 			| CWEventMask | CWColormap, &xw.attrs);
 	if (parent != root)
@@ -1180,10 +1201,8 @@ xinit(int cols, int rows)
 
 	memset(&gcvalues, 0, sizeof(gcvalues));
 	gcvalues.graphics_exposures = False;
-	dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures,
-			&gcvalues);
-	xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,
-			DefaultDepth(xw.dpy, xw.scr));
+	xw.buf = XCreatePixmap(xw.dpy, xw.win, win.w, win.h,xw.depth);
+	dc.gc = XCreateGC(xw.dpy, xw.win, GCGraphicsExposures,&gcvalues);
 	XSetForeground(xw.dpy, dc.gc, dc.col[defaultbg].pixel);
 	XFillRectangle(xw.dpy, xw.buf, dc.gc, 0, 0, win.w, win.h);
 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值