[Xmonad] X Events in a Status Bar

Andrea Rossato mailing_list at istitutocolli.org
Tue Jul 17 07:44:00 EDT 2007


On Tue, Jul 17, 2007 at 01:12:16PM +0200, Robert Manea wrote:
> * Andrea Rossato (mailing_list at istitutocolli.org) wrote:
> > Now, how can you handle X Events in such a situation and specifically
> > an Exposure event?
> 
> Well, you would keep the already rendered string in apixmap. 
> 
> This pixmap will be updated whenever you read a new value, actually
> whenever you would need to build a new string out of your list.
> 
> On expose events you just copy that pixmap into the window, without any
> further cheks.
> 
> By definition that pixmap always consists of the newest values you
> could get.
> 
> Or did I get something wrong?

perhaps my description was unclear. The string to be displayed is
updated according to a configurable frequency (default 1 sec.), with
or without an Expose event.

For instance, in dzen you have a "while running handle_xev()", and
handle_xev is a case analysis ("switch case Exposure" etc etc).

Now, as far as I know, dzen receives a string and prints it.

Now, my loop is: "while running":
1. readVariablesSetByOtherThreads()
2. printVariablesInPixmap
3. copyPixmapToWindow
4. start reading again.

That is to, I cannot use XNextEvent because that is going to stop my
thread since a new expose event is read.

Now can I intercept an Expose event without XNextEvent()? Or, is
there a function like XNextEvent that takes a timeout argument?

Thanks for your kind attention (as usual!).

Andrea


More information about the Xmonad mailing list