On Thu, 24 Jan 2019 10:33:56 +0100
Axel Svensson <[email protected]> wrote:

Hey Axel,

> I noticed that st does not update its keyboard mapping when it is
> changed, e.g. by xmodmap.
> Please see fix at https://uxu.se/st-xRefreshKBM-20190124-3be4cf1.diff

just for posterity's sake, I attached the diff to this response. No
offense, but I don't think this link will work in 5 years, and next
time, feel free to just attach it.

The diff looks good to me, but maybe there are objections by somebody
more familiar with X11-signals.

With best regards

Laslo Hunhold

-- 
Laslo Hunhold <[email protected]>
diff --git a/x.c b/x.c
index 0422421..7e725dc 100644
--- a/x.c
+++ b/x.c
@@ -155,6 +155,7 @@ static int evrow(XEvent *);
 
 static void expose(XEvent *);
 static void visibility(XEvent *);
+static void mapping(XEvent *);
 static void unmap(XEvent *);
 static void kpress(XEvent *);
 static void cmessage(XEvent *);
@@ -181,6 +182,7 @@ static void (*handler[LASTEvent])(XEvent *) = {
 	[ClientMessage] = cmessage,
 	[ConfigureNotify] = resize,
 	[VisibilityNotify] = visibility,
+	[MappingNotify] = mapping,
 	[UnmapNotify] = unmap,
 	[Expose] = expose,
 	[FocusIn] = focus,
@@ -1569,6 +1571,13 @@ visibility(XEvent *ev)
 }
 
 void
+mapping(XEvent *ev)
+{
+	XMappingEvent *e = &ev->xmapping;
+	XRefreshKeyboardMapping(e);
+}
+
+void
 unmap(XEvent *ev)
 {
 	win.mode &= ~MODE_VISIBLE;

Attachment: pgpJgdapoaBcs.pgp
Description: PGP signature

Reply via email to