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 705970 - proctable: handle selection smartly when opening context menu
proctable: handle selection smartly when opening context menu
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2013-08-14 09:22 UTC by Stefano Facchini
Modified: 2013-08-14 21:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proctable: handle selection smartly when opening context menu (1.80 KB, patch)
2013-08-14 09:22 UTC, Stefano Facchini
none Details | Review
proctable: handle selection smartly when opening context menu (1.84 KB, patch)
2013-08-14 09:25 UTC, Stefano Facchini
none Details | Review
proctable: handle selection smartly when opening context menu (1.89 KB, patch)
2013-08-14 12:26 UTC, Stefano Facchini
committed Details | Review

Description Stefano Facchini 2013-08-14 09:22:43 UTC
see patch
Comment 1 Stefano Facchini 2013-08-14 09:22:44 UTC
Created attachment 251587 [details] [review]
proctable: handle selection smartly when opening context menu

When the context menu is triggered by a mouse event, check the row
under the cursor: if it is not already part of the selection, select it
and deselect everything else.

This is the most common behavior, used for instance by Nautilus etc.
Comment 2 Stefano Facchini 2013-08-14 09:25:14 UTC
Created attachment 251588 [details] [review]
proctable: handle selection smartly when opening context menu

When the context menu is triggered by a mouse event, check the row
under the cursor: if it is not already part of the selection, select it
and deselect everything else.

This is the most common behavior, used for instance by Nautilus etc.



... forgot to free the GtkTreePath
Comment 3 Robert Roth 2013-08-14 09:41:55 UTC
Haven't checked the behaviour on this while running, but I don't like the "check the row under the cursor: if it is not already part of the selection, select it
and deselect everything else.", especially the "deselect everything else". 

I have just tried it in nautilus, maybe I missunderstood your description:
* selected file1
* press Ctrl
* right click file2
=> The actions are for all files, not only file2, and file1 remains selected.
This is what we want in GSM, to be able to execute actions (kill, end) on multiple processes. If we deselect everything else if the context menu is triggered by a mouse event and the row is not part of the selection, we will break this.
Will get back after I have actually tried this.
Comment 4 Stefano Facchini 2013-08-14 12:25:13 UTC
You're right that I didn't take into account the Control modifier, a new patch is attached fixing it. But apart from this, the behavior should be exactly like nautilus, the old selection is preserved if the click event is inside it. What I don't like of the current behavior is that clicking in a random point of the GtkTreeView opens a context menu for the existing selection. Give it a try and let me know :)
Comment 5 Stefano Facchini 2013-08-14 12:26:07 UTC
Created attachment 251608 [details] [review]
proctable: handle selection smartly when opening context menu

When the context menu is triggered by a mouse event, check the row
under the cursor: if it is not already part of the selection, select it
and deselect everything else.

This is the most common behavior, used for instance by Nautilus etc.
Comment 6 Robert Roth 2013-08-14 21:04:14 UTC
Attachment 251608 [details] pushed as e3a4285 - proctable: handle selection smartly when opening context menu