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 666606 - 'free the fish' does not work
'free the fish' does not work
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2011-12-20 17:49 UTC by Giovanni Campagna
Modified: 2011-12-20 19:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Reintroduce Wanda The Fish (10.97 KB, patch)
2011-12-20 17:49 UTC, Giovanni Campagna
reviewed Details | Review
StTextureCache: fix load_sliced_image with different sizes (1.20 KB, patch)
2011-12-20 18:25 UTC, Giovanni Campagna
committed Details | Review
IconGrid: don't force the size of the icon (1.92 KB, patch)
2011-12-20 18:25 UTC, Giovanni Campagna
committed Details | Review
Reintroduce Wanda The Fish (9.12 KB, patch)
2011-12-20 18:27 UTC, Giovanni Campagna
committed Details | Review

Description Giovanni Campagna 2011-12-20 17:49:24 UTC
Description of the problem:
'free the fish' does not report results.

Steps to reproduce:
- enter the overview
- type "free the fish" in the search bar

Expected result:
Wanda the fish magically appears.
Clicking on it shows the output of fortune (or another similar command).

Actual results:
None.

(yeah, it's Christmas not Easter, but it's fun anyway :D)
Comment 1 Giovanni Campagna 2011-12-20 17:49:52 UTC
Created attachment 203969 [details] [review]
Reintroduce Wanda The Fish

When transitioning from gnome-panel to gnome-shell in 3.0 we
lost the ability to summon the wisdom of the mythical fish.
This patch restores this, for the few adepts that are aware of
the magical incantation.
(Not as configurable as the original one, but it's an easter egg
after all...)
Comment 2 Colin Walters 2011-12-20 18:08:16 UTC
Review of attachment 203969 [details] [review]:

::: js/ui/iconGrid.js
@@ +37,3 @@
         this.iconSize = ICON_SIZE;
+        this._iconBin = new St.Bin({ x_align: St.Align.MIDDLE,
+                                     y_align: St.Align.MIDDLE });

All these changes should be a separate patch.

::: js/ui/wanda.js
@@ +19,3 @@
+
+// FIXME make this configurable
+const GNOME_PANEL_PIXMAPDIR = '/usr/share/gnome-panel/pixmaps';

I'd use global.datadir + "/../gnome-panel-pixmaps".

@@ +152,3 @@
+				  Math.floor(monitor.height / 2 - this._button.height / 2));
+
+	GLib.timeout_add(GLib.PRIORITY_DEFAULT, 10000, Lang.bind(this, this.destroy));

Might as well use timeout_add_seconds.

@@ +177,3 @@
+                 'createIcon': function(iconSize) {
+                     // for DND only (maybe could be improved)
+                     // DON'T use St.Icon here, it crashes the shell

Why?

::: src/st/st-texture-cache.c
@@ +1230,2 @@
     {
+      for (x = 0; x < width; x += data->grid_width)

This looks correct, but it should be a separate patch.
Comment 3 Giovanni Campagna 2011-12-20 18:25:44 UTC
Created attachment 203972 [details] [review]
StTextureCache: fix load_sliced_image with different sizes

grid_width and grid_height were inverted, which caused a crash
in GdkPixbuf code. This was never noticed because the animation
in the panel is a square.
Comment 4 Giovanni Campagna 2011-12-20 18:25:53 UTC
Created attachment 203973 [details] [review]
IconGrid: don't force the size of the icon

Forcing the icon size will distort it unnecessarily, and will
in any case not work if showing an animation (which is a ClutterGroup).
Instead, set the size on the bin, and make it align its child
if needed.
Comment 5 Giovanni Campagna 2011-12-20 18:27:35 UTC
Created attachment 203974 [details] [review]
Reintroduce Wanda The Fish

When transitioning from gnome-panel to gnome-shell in 3.0 we
lost the ability to summon the wisdom of the mythical fish.
This patch restores this, for the few adepts that are aware of
the magical incantation.
(Not as configurable as the original one, but it's an easter egg
after all...)
Comment 6 Colin Walters 2011-12-20 18:43:35 UTC
Review of attachment 203972 [details] [review]:

Perfect, thanks.
Comment 7 Colin Walters 2011-12-20 18:44:52 UTC
Review of attachment 203973 [details] [review]:

Makes sense to me, thanks!
Comment 8 Colin Walters 2011-12-20 18:53:05 UTC
Review of attachment 203974 [details] [review]:

One comment - feel free to commit with or without addressing it though.

::: js/ui/wanda.js
@@ +43,3 @@
+	    this._imgWidth = tmpPixbuf.width / this._keyfile.get_integer(FISH_GROUP, 'frames');
+	} catch(e) {
+	    log('Unable to load the Fish! Bad luck on you: ' + e.message);

Just one more thing - we should be careful with broad "catch (e)" handlers like this.  It might be better to just do:

if (GLib.file_test(file, GLib.FileTest.EXISTS)) {


}

Yeah, we then crash harder if the fish file doesn't have a "frames" key or whatever (and you could if you wanted be more robust here) but there are plenty of other malformed data files in the filesystem that will also make us crash too, so it's not worth worrying about.
Comment 9 Giovanni Campagna 2011-12-20 19:07:05 UTC
Attachment 203972 [details] pushed as 875b6d1 - StTextureCache: fix load_sliced_image with different sizes
Attachment 203973 [details] pushed as 26580f8 - IconGrid: don't force the size of the icon
Attachment 203974 [details] pushed as 50aa15d - Reintroduce Wanda The Fish