aboutsummaryrefslogtreecommitdiff
path: root/x.c.rej
diff options
context:
space:
mode:
authorLoek Le Blansch <l.leblansch@gmail.com>2020-07-16 11:20:56 +0200
committerLoek Le Blansch <l.leblansch@gmail.com>2020-07-16 11:20:56 +0200
commit6abda3faad50bdf96c994c9a5fd41f275e7d6842 (patch)
treef4840fbd31bee5f2cde6b739e40301fb209fcdd7 /x.c.rej
parent1fe8489deda0f8efc407d7b05df0eedce452ffef (diff)
alpha + config
Diffstat (limited to 'x.c.rej')
-rw-r--r--x.c.rej31
1 files changed, 24 insertions, 7 deletions
diff --git a/x.c.rej b/x.c.rej
index 035510e..860c2dd 100644
--- a/x.c.rej
+++ b/x.c.rej
@@ -1,10 +1,27 @@
--- x.c
+++ x.c
-@@ -409,6 +409,7 @@ bpress(XEvent *e)
- {
- struct timespec now;
- MouseShortcut *ms;
-+ MouseKey *mk;
- int snap;
+@@ -1013,11 +1022,23 @@ xinit(int cols, int rows)
+ Window parent;
+ pid_t thispid = getpid();
+ XColor xmousefg, xmousebg;
++ XWindowAttributes attr;
++ XVisualInfo vis;
- if (IS_SET(MODE_MOUSE) && !(e->xbutton.state & forceselmod)) {
+ if (!(xw.dpy = XOpenDisplay(NULL)))
+ die("can't open display\n");
+ xw.scr = XDefaultScreen(xw.dpy);
+- xw.vis = XDefaultVisual(xw.dpy, xw.scr);
++
++ if (!(opt_embed && (parent = strtol(opt_embed, NULL, 0)))) {
++ parent = XRootWindow(xw.dpy, xw.scr);
++ xw.depth = 32;
++ } else {
++ XGetWindowAttributes(xw.dpy, parent, &attr);
++ xw.depth = attr.depth;
++ }
++
++ XMatchVisualInfo(xw.dpy, xw.scr, xw.depth, TrueColor, &vis);
++ xw.vis = vis.visual;
+
+ /* font */
+ if (!FcInit())