xbindkeys-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xbindkeys-devel] Re: ghastly 10hz polling loop


From: Philippe Brochard
Subject: [Xbindkeys-devel] Re: ghastly 10hz polling loop
Date: Sun, 24 Jan 2010 21:53:31 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Alexander Clouter writes:

> * Philippe Brochard <address@hidden> [2010-01-23 23:58:32+0100]:
>>
>> > I have attached two patches that fix both these problems, the later
>> > patch makes the polling optional (by default turned off as realistically
>> > this file should not be amended regularly in the Real World[tm]).
>> >
>> Well, another solution is to increase the SLEEP_TIME variable to
>> something less stressing for your battery (indeed 10hz is fairly
>> quick for this purpose). BTW your patch can be useful and has been
>> applied.
>>
> *Anything* that poll/select's with a timeout is a Bad Idea(tm).  I was
> tempted to use F_(SET|GET)LEASE as documented in fcntl(2) which should
> do the job better than the current method, however as I cannot see the
> poll'ing feature being use in production (only when people are trying to
> get their configuration file perfected) it probably is not worth it and
> could just overly complicate things.
>
I think you're right: the poll method does (badly) its job but it's
not really necessary to waste too many time to add a feature used 1%
of the xbindkeys use time.
It's here that your poll-rc flag is really useful!

> Using inotify would have made the thing simplier, but that would have
> made it a Linux only solution so not really an acceptable solution for
> xbindkeys.
>
Yes, I'd prefer to let xbindkeys portable among unixes.

>> > Please, next time run 'strace' on any code you write ;)
>> >
>> Thanks for the tip and many thanks for your patchs.
>>
> It's a real shame that X11 has to inform xbindkeys regarding *every*
> keypress and that a filter cannot be further applied to trim the
> unwanted keyboard input.  Well, I could see anything glancing over the
> Xlib documentation, you might know of a secret gem or two you can call
> on though :)
>
Filters is what I have in mind when I've started xbindkeys times
ago. I've had many headache and didn't find a simple solution...
BTW I have filters now with CLFSWM [1] but I have had to write my own
window manager. For examples a key press or a button click can be
intercepted by CLFSWM or passed to the application window following
some criteria.


>> Please, can you can test them from the git repo before I do a new
>> relase ?
>>
>> https://savannah.nongnu.org/projects/xbindkeys/
>> https://savannah.nongnu.org/git/?group=xbindkeys
>>
> Seems to work perfectly here.
>
Ok, good!

> I have attached an additional minor tweak to stop the required
> initial stat()'s if we are not going to poll the configuration files
> for changes.
>
Applied! Thanks a lot for your patch!

Regards,

Philippe


[1] http://common-lisp.net/project/clfswm/






reply via email to

[Prev in Thread] Current Thread [Next in Thread]