insert idle/timeout handler into gtk loop



HI!!


In a gnome applet I'm writing, I'd like to monitor if
the user changed workspaces. The function gnome_wmhints_
get_current_workspace() returns the workspace number. So
I figured I'd insert an idle handler into the gtk main
loop, with low priority, that can monitor workspace 
changes if gtk is not doing anything else. This works,
but even when I use the lowest priority (G_PRIORITY_LOW)
for inserting the handler, the app takes up so much cpu 
time that my laptop fan has to blow all the time (50% 
cpu time on a 800Mhz pIII). So for now I solved the 
problem by using a 100ms timeout instead of an idle 
handler. I was wondering if here is anothere way of 
monitoring a quantity and it also seems strange to me that 
an idle handler with the lowest priority takes up so
much cpu time.

best regards

jos




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