GNOME Bugzilla – Bug 666606
'free the fish' does not work
Last modified: 2011-12-20 19:07:16 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)
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...)
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.
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.
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.
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...)
Review of attachment 203972 [details] [review]: Perfect, thanks.
Review of attachment 203973 [details] [review]: Makes sense to me, thanks!
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.
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