Re: [hackers] [dmenu][PATCH] fix a bug introduced by e2a2805 that that ignores composed characters

From: nzl <uruabi_AT_gmail.com>
Date: Sat, 17 Mar 2018 03:17:05 +0800

Hi, I tried your patch on origin/master, it works as expected. But
there's still one related issue, that is the cursor position isn't
rendered correctly when using multiple fonts. I suggest making the
following changes to account for that:

_AT_@ -131,6 +131,7 @@ drawmenu(void)
        unsigned int curpos;
        struct item *item;
        int x = 0, y = 0, w;
+ char ch;

        drw_setscheme(drw, scheme[SchemeNorm]);
        drw_rect(drw, 0, 0, mw, mh, 1, 1);
_AT_@ -144,7 +145,10 @@ drawmenu(void)
        drw_setscheme(drw, scheme[SchemeNorm]);
        drw_text(drw, x, 0, w, bh, lrpad / 2, text, 0);

- drw_font_getexts(drw->fonts, text, cursor, &curpos, NULL);
+ ch = text[cursor];
+ text[cursor] = '\0';
+ curpos = drw_fontset_getwidth(drw, text);
+ text[cursor] = ch;

Thank you.

On Sat, Mar 17, 2018 at 12:03 AM, Hiltjo Posthuma
<hiltjo_AT_codemadness.org> wrote:
> On Fri, Mar 16, 2018 at 10:12:52PM +0800, nzl wrote:
>> > Which IME method are you using?
>> > I confess I don't use IME and didn't think about testing it, but now I
>> > did with fcitx and while it seems to work for most other programs, I
>> > can't spawn it with dmenu with or without the changes you're
>> > questioning.
>>
>> I'm using fcitx.
>>
>> > Could you provide me with more details about your setup so we can reproduce the issue?
>>
>> To reproduce this issue, apply this patch:
>> https://groups.google.com/group/wmii/attach/ccc8c3e8c734/dmenu-im.patch?part=0.1
>> Then activate fcitx, input some text, it doesn't matter what
>> characters are input,
>> the status returned from XmbLookupString is always XLookupChars.
>>
>
> Thanks for the report. Can you try the following patch (and dmenu git):
>
> clone: git://git.suckless.org/dmenu
> apply patch: https://cow.codemadness.org/paste/dmenu-ime.patch
>
> Please let me know of any issues,
>
> --
> Kind regards,
> Hiltjo
>
Received on Fri Mar 16 2018 - 20:17:05 CET

This archive was generated by hypermail 2.3.0 : Fri Mar 16 2018 - 20:24:27 CET