diff options
| author | auric <auric7@protonmail.com> | 2025-09-08 21:27:55 -0500 |
|---|---|---|
| committer | auric <auric7@protonmail.com> | 2025-09-08 21:27:55 -0500 |
| commit | de07b49b3249da05605f8c802b991a8588ab63b3 (patch) | |
| tree | 295d6003f08dfce1d1b779892ce9c0be97d426a3 /archive/st/patch/st_embedder_x.c | |
| parent | 04cfeeb799b4ee6ac990e5d6e1b5302251133d77 (diff) | |
| parent | e61da07522a060da98fa3a56db3d0360469b26cf (diff) | |
Resolved conflict, indulging new file layout
Diffstat (limited to 'archive/st/patch/st_embedder_x.c')
| -rw-r--r-- | archive/st/patch/st_embedder_x.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/archive/st/patch/st_embedder_x.c b/archive/st/patch/st_embedder_x.c new file mode 100644 index 0000000..c73c389 --- /dev/null +++ b/archive/st/patch/st_embedder_x.c @@ -0,0 +1,50 @@ +static Window embed; + +void +createnotify(XEvent *e) +{ + XWindowChanges wc; + + if (embed || e->xcreatewindow.override_redirect) + return; + + embed = e->xcreatewindow.window; + + XReparentWindow(xw.dpy, embed, xw.win, 0, 0); + XSelectInput(xw.dpy, embed, PropertyChangeMask | StructureNotifyMask | EnterWindowMask); + + XMapWindow(xw.dpy, embed); + sendxembed(XEMBED_EMBEDDED_NOTIFY, 0, xw.win, 0); + + wc.width = win.w; + wc.height = win.h; + XConfigureWindow(xw.dpy, embed, CWWidth | CWHeight, &wc); + + XSetInputFocus(xw.dpy, embed, RevertToParent, CurrentTime); +} + +void +destroynotify(XEvent *e) +{ + visibility(e); + if (embed == e->xdestroywindow.window) { + focus(e); + } +} + +void +sendxembed(long msg, long detail, long d1, long d2) +{ + XEvent e = { 0 }; + + e.xclient.window = embed; + e.xclient.type = ClientMessage; + e.xclient.message_type = xw.xembed; + e.xclient.format = 32; + e.xclient.data.l[0] = CurrentTime; + e.xclient.data.l[1] = msg; + e.xclient.data.l[2] = detail; + e.xclient.data.l[3] = d1; + e.xclient.data.l[4] = d2; + XSendEvent(xw.dpy, embed, False, NoEventMask, &e); +} |
