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 782982 - Cannot trigger garbage collection from Looking Glass
Cannot trigger garbage collection from Looking Glass
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: looking-glass
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-05-23 08:46 UTC by Debarshi Ray
Modified: 2017-05-24 22:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
lookingGlass: Use standard icon names for GC icon (1.88 KB, patch)
2017-05-23 09:16 UTC, Florian Müllner
none Details | Review
lookingGlass: Use standard icon names for GC icon (1.87 KB, patch)
2017-05-23 10:01 UTC, Florian Müllner
committed Details | Review

Description Debarshi Ray 2017-05-23 08:46:56 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.)
Comment 1 Florian Müllner 2017-05-23 09:16:54 UTC
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' ...
Comment 2 Rui Matos 2017-05-23 09:46:00 UTC
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?
Comment 3 Florian Müllner 2017-05-23 10:01:21 UTC
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)
Comment 4 Debarshi Ray 2017-05-23 10:30:52 UTC
(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.
Comment 5 Florian Müllner 2017-05-24 22:00:16 UTC
Attachment 352402 [details] pushed as 7e7e3ec - lookingGlass: Use standard icon names for GC icon