Re: [dev] [dmenu] 4.9 segfault on input

From: Silvan Jegen <s.jegen_AT_gmail.com>
Date: Mon, 11 Feb 2019 21:42:10 +0100

Hi

On Mon, Feb 11, 2019 at 1:44 AM Patrick Smith <pat42smith_AT_gmail.com> wrote:
> Jordan, I tried a similar patch, and yes it does work for me. My
> message reporting that may have been delayed by moderation or
> something, I'm not sure.
>
> One drawback to this is that seems to disable the user's input method.
> If, for example, I do
>
> printf 'あ\nお' | ./dmenu
>
> (that contains Japanese hiragana characters in the menu), then I can
> select the first option by just pressing enter, but I can't find a way
> to select the second option.
>
> This doesn't bother me; my actual menus only use English. But it might
> possibly bother other dmenu users.

I found that the XSetLocaleModifiers("") call returns "_AT_im=ibus" in my
case which is not surprising because the env variable XMODIFIERS is
set to _AT_im=ibus on my machine. If Ibus is not running, however, I get
a segfault just like Jordan ("XOpenIM" returns NULL in that case). If
IBus is running, everything works fine.

Not calling XSetLocaleModifiers makes sure that the segfault doesn't
happen but then IBus doesn't work with dmenu for me. If I call
XSetLocaleModifiers twice like in the proposed patch, if no IBus is
running I don't get a segfault but if it is running, I seem to be able
to use IBus for input in dmenu (even though I never use it).

To me it seems like this patch fixes the crashes in the case that your
XIM IME is not set (or not running) and it lets you use your IME as
long as your XMODIFIERS is set to the correct value. This patch thus
works for me but I am not sure what is implied if you set
XSetLocaleModifiers("_AT_im=local").

I also found this:
https://gitlab.tankernn.eu/Tankernn/st/commit/4e14a4a97f7f7ef134fdc25d2fa34c8db7bb6e6c?view=parallel
:P


Cheers,

Silvan
Received on Mon Feb 11 2019 - 21:42:10 CET

This archive was generated by hypermail 2.3.0 : Mon Feb 11 2019 - 21:48:07 CET