Re: How to add a callback that will be called each time when the event queue becomes empty
- From: "Jasper St. Pierre" <jstpierre mecheye net>
- To: Gang Chen <gang chen cn gmail com>
- Cc: richard boaz <ivor boaz gmail com>, gtk-list <gtk-list gnome org>
- Subject: Re: How to add a callback that will be called each time when the event queue becomes empty
- Date: Fri, 19 Jul 2013 15:51:18 -0400
Low-priority idles *are* called every time the event queue is empty. Which could happen quite a lot when the application isn't really doing anything else.
I don't know why your idle is causing 100% CPU usage, though. You're not doing any heavy processing in there, right? If you recalculate the state, and that causes set_sensitive to be called with the same value it was before, we won't redraw the UI or anything.
If the idle indeed is doing heavy processing, then the only thing you can do is to call it when a state change happens somewhere. Yes, there can be lots of state changes, but that's what entire signal system is for. Perhaps also look at g_object_bind_property / properties / notify::prop signals?
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]