all repos — st @ 8503f954a1cb2d08124fe2c1f0227bd23dffff46

st (suckless terminal) config

fix focus state when embed in another window.
Aurélien Aptel aurelien.aptel@gmail.com
commit

8503f954a1cb2d08124fe2c1f0227bd23dffff46

parent

cddbd6eee59104a029087c30f9ff5e7e415bc584

1 files changed, 5 insertions(+), 2 deletions(-)

jump to
M st.cst.c

@@ -241,6 +241,8 @@ [ConfigureNotify] = resize,

[VisibilityNotify] = visibility, [UnmapNotify] = unmap, [Expose] = expose, + [EnterNotify] = focus, + [LeaveNotify] = focus, [FocusIn] = focus, [FocusOut] = focus, [MotionNotify] = bmotion,

@@ -1635,7 +1637,8 @@ attrs.border_pixel = dc.col[DefaultBG];

attrs.bit_gravity = NorthWestGravity; attrs.event_mask = FocusChangeMask | KeyPressMask | ExposureMask | VisibilityChangeMask | StructureNotifyMask - | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask; + | ButtonMotionMask | ButtonPressMask | ButtonReleaseMask + | EnterWindowMask | LeaveWindowMask; attrs.colormap = xw.cmap; parent = opt_embed ? strtol(opt_embed, NULL, 0) : XRootWindow(xw.dpy, xw.scr);

@@ -1819,7 +1822,7 @@ }

void focus(XEvent *ev) { - if(ev->type == FocusIn) { + if(ev->type == FocusIn || ev->type == EnterNotify) { xw.state |= WIN_FOCUSED; xseturgency(0); } else