window visibility notification

i have a program that updates a few labels very frequently based on some 
system stuff.  there is an idle function that uses up a great deal of 
processing power.  what i want to do is only have it update when it is on 
the screen, thereby reducing the amount of processor it takes up; if i want 
it to stop sucking resources, i'll just collapse it or move it to another 
desktop etc.

i looked at GDK_VISIBILITY_NOTIFY_MASK, but it seems like i would have to 
make a lot of assumptions in order to use this.  if i collapse the window, 
it creates two of these events, if i move to another desktop it only makes 
one.  my initial idea was to have a counter that increments each time the 
visibility function is called, and it would toggle the updating based on the 
parity of the counter.

if anyone has any ideas about this, of has done it before, thanks for your 
-ben k.

Get Your Private, Free E-mail from MSN Hotmail at

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