Re: [dev] [hack] Having dmenu provide hints about current selected entry

From: Ramil Farkhshatov <ramil_AT_gmx.co.uk>
Date: Wed, 01 Dec 2010 04:34:43 +0300

Christophe-Marie Duquesne <chm.duquesne_AT_gmail.com> wrote:

> On Mon, Nov 29, 2010 at 2:44 AM, Connor Lane Smith <cls_AT_lubutu.com> wrote:
> > Great, it's a lot cleaner this way. One problem with this approach,
> > though, is that if data is written to stdin it isn't displayed until
> > the next X event. This is likely fine for your use case, and
> > dmenu_run, but perhaps not for other cases. To fix that we'd have to
> > select between stdin and XConnectionNumber(dc->dpy).
>
> Here is a patch that implements this idea (still available on my
> bitbucket repo). It actually makes dmenu pretty slow to read stdin.
> comments/fix are welcome.

Attached patch against dmenu-4.2.1 is based on yours but with some
changes.

It reads stdin by blocks not by line that is noticeably reduces number
of invokes of readstdin() and whole select() machinery.
And it doesn't run match() on each item, that increases speed and
reduces cpu usage. But conditions to run match() must be reconsidered:
in this patch it is called once a second.

Received on Wed Dec 01 2010 - 02:34:43 CET

This archive was generated by hypermail 2.2.0 : Wed Dec 01 2010 - 02:48:03 CET