2012/4/18 Victor Eduardo <victoredua...@gmail.com> > Hey Sergey, all these are awesome ideas! > > I can rewrite your script on my free time (i.e. after I'm done with > relevant Noise stuff). Coding it in directly C might be safer in my > opinion. Did you push it to some branch? > > Regards, > Victor >
Hey Victor, I'm glad to hear that! Tom Beckmann already wrote a proof-of-concept in Vala, see http://pastebin.com/BVTGsMmK It's not production-ready for two reasons: first, it uses Process. spawn_command_line_sync() which is a wrapper to system() function which is dreadfully insecure. It should use setpriority() function instead (see "man setpriority" or view it online at http://manpages.ubuntu.com/manpages/precise/en/man3/setpriority.3posix.html). Second, it doesn't prevent process children from inheriting high priority, and doesn't drop priorities of child processes on unfocusing the window. I've recently discovered that ulatencyd provides a D-bus interface to manage process priorities, it probably would be better just to signal it instead of doing everything ourselves. It will also solve the priority inheritance puzzle. Also, I still haven't figured out how ulatencyd's Xorg "data provider" works. All I know is that it's polling-based (which is not necessarily a bad idea, because quick focus switching with e.g. Alt+Tab can switch focus very quickly and make ulatencyd use CPU a lot) and it doesn't seem to work unless ulatencyd is started from X manually (probably doesn't detect session changes). Maybe it's better to fix ulatencyd's data provider than to write something custom. I suppose I'll be posting a message to ulatencyd mailing list soon, I'll ask why it's so and what approach should we take. -- Sergey "Shnatsel" Davidoff
-- Mailing list: https://launchpad.net/~elementary-dev-community Post to : elementary-dev-community@lists.launchpad.net Unsubscribe : https://launchpad.net/~elementary-dev-community More help : https://help.launchpad.net/ListHelp