GNOME Bugzilla – Bug 705970
proctable: handle selection smartly when opening context menu
Last modified: 2013-08-14 21:04:17 UTC
see patch
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.
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
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.
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 :)
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.
Attachment 251608 [details] pushed as e3a4285 - proctable: handle selection smartly when opening context menu