GNOME Bugzilla – Bug 782982
Cannot trigger garbage collection from Looking Glass
Last modified: 2017-05-24 22:00:21 UTC
I don't see the 'trash' icon in Looking Glass' toolbar even though js/ui/lookingGlass.js has: let gcIcon = new St.Icon({ icon_name: 'gnome-fs-trash-full', icon_size: 24 }); toolbar.add_actor(gcIcon); gcIcon.reactive = true; gcIcon.connect('button-press-event', Lang.bind(this, function () { gcIcon.icon_name = 'gnome-fs-trash-empty'; System.gc(); this._timeoutId = Mainloop.timeout_add(500, Lang.bind(this, function () { gcIcon.icon_name = 'gnome-fs-trash-full'; this._timeoutId = 0; return GLib.SOURCE_REMOVE; })); I don't think I have an icon called 'gnome-fs-trash-full' because locate(1) can't find it. (I am unsure if running 'System.gc()' directly from the Looking Glass prompt is the right thing to do because it says 'undefined', even though the System object actually has a method called 'gc'. Maybe it's just confused about the return value.)
Created attachment 352398 [details] [review] lookingGlass: Use standard icon names for GC icon Commit b929320d4 added a toolbar item to force garbage collection, however it won't be visible for most users, as it uses a non-standard legacy icon name (the default icon theme dropped it as far back as 2009). (In reply to Debarshi Ray from comment #0) > I don't see the 'trash' icon in Looking Glass' toolbar even though > js/ui/lookingGlass.js has: Wow, I must admite that I had no idea that it was there ... > (I am unsure if running 'System.gc()' directly from the Looking Glass prompt > is the right thing to do because it says 'undefined', even though the System > object actually has a method called 'gc'. Maybe it's just confused about the > return value.) Yeah, void return values show up as 'undefined' ...
Review of attachment 352398 [details] [review]: ::: js/ui/lookingGlass.js @@ +839,3 @@ gcIcon.reactive = true; gcIcon.connect('button-press-event', Lang.bind(this, function () { + gcIcon.icon_name = 'user-trash-empty'; I only see 'user-trash' and 'user-trash-full' (plus symbolic variants) on my system. You have an -empty variant?
Created attachment 352402 [details] [review] lookingGlass: Use standard icon names for GC icon (In reply to Rui Matos from comment #2) > I only see 'user-trash' and 'user-trash-full' (plus symbolic variants) on my > system. You have an -empty variant? No, I don't. I blindly replaced the 'gnome-fs' prefix and gave it a quick test ('user-trash-empty' falls back to 'user-trash', so it accidentally works)
(In reply to Florian Müllner from comment #1) > > (I am unsure if running 'System.gc()' directly from the Looking Glass prompt > > is the right thing to do because it says 'undefined', even though the System > > object actually has a method called 'gc'. Maybe it's just confused about the > > return value.) > > Yeah, void return values show up as 'undefined' ... Thanks for confirming that.
Attachment 352402 [details] pushed as 7e7e3ec - lookingGlass: Use standard icon names for GC icon