GNOME Bugzilla – Bug 667227
Change priority problems
Last modified: 2012-01-14 00:57:46 UTC
To reproduce: 1. Start system monitor as a normal user 2. Select All processes from the view menu 3. Click on a process with high priotity owned by root Expected result: nothing happens What happens: an error dialog is shown that the priority can not be changed Reason: When a process is selected, for the priority radio actions to reflect the current priority the selected radio item is set based on the current nice value, BUT when changing the selected radio item, the renice function is called. Either the renice function should return without doing anything when the new nice value equals the current nice value, or the handler for the selected priority action changed should be disabled in the cb_row_selected method before setting the selected priority radio action and enabled afterwards.
Created attachment 204538 [details] [review] Proposed patch Disable the priority changed handler while setting the current priority radio menu item. Also changed renice_single_process to return if the desired nice value equals the current one, as a minor optimization.
Created attachment 204540 [details] [review] Proposed patch v2 A bit improved the previous version of the patch. The handlers are now disabled before setting the current priority radio item, and reenabled afterwards in a loop.
Taking a quick look, this seems quite hacky but it does fix the issue. If you get the itching, a nicer fix would be welcome.