GNOME Bugzilla – Bug 710042
appDisplay: Remember selected view across sessions
Last modified: 2013-10-15 18:11:39 UTC
See patch. This is what Allan and Jakub agreed on, see https://bugzilla.gnome.org/show_bug.cgi?id=709179#c4.
Created attachment 257175 [details] [review] appDisplay: Remember selected view across sessions The application picker will always open with the view that was last selected during the session, but the selection is reset on each restart. This results in some annoyance for users that use the ALL view exclusively, as they have to toggle views once each session - the same would apply to exclusive FREQUENT view users were the defaults to be changed, so the best solution is to simply make the selected view persistent by storing it in GSettings.
Review of attachment 257175 [details] [review]: ::: js/ui/appDisplay.js @@ +745,3 @@ function(actor) { this._showView(viewIndex); + global.settings.set_int('app-picker-view', viewIndex); Should we delay saving the setting to the disk with a timeout? Otherwise looks good to me. @@ +749,3 @@ } + let initialView = Math.min(global.settings.get_int('app-picker-view'), + this._views.length - 1); Technically, because this is a int, not a uint, it could be negative. I don't think anyone would purposefully set -1 to break the shell though...
(In reply to comment #2) > Should we delay saving the setting to the disk with a timeout? I don't really see why - a reasonable timeout would need to be big enough to allow users to move the mouse and click for any benefit, while still being small enough to not increase the risk of ending the session during the timeout too much (so let's say - 30s?). How many times would users normally change views in that time? The only case where I can see some saving in disk activity is when working on stuff like view transitions, but this doesn't look worthwhile to me optimizing for ... - we only set the value as result of user interaction (e.g. when one of the buttons is clicked, not when changing the view automatically due to some other condition), so I only see us saving a bit of disk activity when users frantically switch between views (do they?) at the risk of breaking user expectation because we > @@ +749,3 @@ > Technically, because this is a int, not a uint, it could be negative. It's using a range restriction but yeah, could just as well use uint ...
Attachment 257175 [details] pushed as 5a7e854 - appDisplay: Remember selected view across sessions