After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 667227 - Change priority problems
Change priority problems
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: process list
3.3.x
Other Linux
: Normal normal
: ---
Assigned To: System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2012-01-03 22:33 UTC by Robert Roth
Modified: 2012-01-14 00:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (1.45 KB, patch)
2012-01-03 22:59 UTC, Robert Roth
none Details | Review
Proposed patch v2 (2.98 KB, patch)
2012-01-03 23:58 UTC, Robert Roth
none Details | Review

Description Robert Roth 2012-01-03 22:33:18 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.
Comment 1 Robert Roth 2012-01-03 22:59:24 UTC
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.
Comment 2 Robert Roth 2012-01-03 23:58:39 UTC
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.
Comment 3 Chris Kühl 2012-01-14 00:57:46 UTC
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.