GNOME Bugzilla – Bug 631563
fixup seed games for glib 2.26 / gobject-introspection 0.9.10 etc.
Last modified: 2011-04-20 17:51:20 UTC
Created attachment 171854 [details] [review] fix libgames-support Makefile.am for gobject-introspection 0.9.10 The seed games (swell-foop and lightsoff) are broken with the current gtk, glib, clutter-gtk, and gobject-introspection 0.9.10. For some strange reason I decided to hack at them until they at least ran, here is the result in 6 patches. I can now at least play a game of swell-foop (running with CLUTTER_VBLANK=dri), although I note it hangs if you try to view the scores and segfaults if you try to open the About dialog.
Created attachment 171855 [details] [review] gobject-introspection fixes for games-conf.c Basically adding enough (allow-none) attributes.
Created attachment 171857 [details] [review] gobject-introspection fixes for games-scores.c It took a while for me to fix the "/** " - note the space, it made gobject-introspection ignore the whole API comment block.
Created attachment 171858 [details] [review] work around clutter init segfault This just works around gnome bug #630990
Created attachment 171859 [details] [review] replace get_children Use a clutter remove_all() function to remove all the actors. get_children() seems to have gone.
Created attachment 171860 [details] [review] comment out main_context stuff I couldn't manage to get the GLib.main_context functions working but it seems to work with them just commented out. I was expecting them to need replacing with GLib.main_context_iteration(true) or GLib.MainContext.iteration(true) or similar, but nothing seemed to work.
Could you create the patches as git commits and attach them formatted from git format-patch (or use git-bz) ? That makes them easier to apply.
Created attachment 172299 [details] [review] gobject-introspection Makefile changes I changed this one to get the scores setgid_ functions incorporated into the gobject-introspection files, and the high scores dialog in swell foop no longer hangs.
Created attachment 172300 [details] [review] gobject-introspection fixes for games-conf.c
Created attachment 172301 [details] [review] gobject-introspection fixes for games-scores.c
Created attachment 172302 [details] [review] work around clutter init segfault
Created attachment 172303 [details] [review] replace get_children
Created attachment 172304 [details] [review] comment out main_context stuff
This seems to work for main_context things (i.e. in Board.js, line 43): var main_context = GLib.main_context_default(); // gets the default main context while(main_context.pending()) main_context.iteration(); I'm not sure if it actually does the same as before. And I don't know what exactly these main context things are used for. Having changed all occurences of main_context_...() to the object-oriented version above, I am now able to play swell foop. However, there is no scores window after the Game Over message pops up. So I basically get the same behaviour commenting these lines out and replacing them with their object-oriented equivalent(?). Not sure if it's better to comment them out or replace them.
(In reply to comment #13) > This seems to work for main_context things (i.e. in Board.js, line 43): > > var main_context = GLib.main_context_default(); // gets the default main > context > while(main_context.pending()) main_context.iteration(); > I just tried that but it doesn't work for me, I get the usual messages: Line 43 in /usr/share/gnome-games/swell-foop/Board.js: TypeError Result of expression 'GLib.main_context_default' [undefined] is not a function. Regarding the scores, it looks like high score saving was never implemented in swell-foop, I think running via seed loses the setgid permissions, so I just set the high score file world-writable (you have to create the empty files yourself too). I then added this line in Scores.js within the game_completed(won) function: highscores.add_score({plain:current_score}); Then some scores get saved, but the saved scores end up as random values.
The About dialog segfault could be fixed by adding where appropriate the (array zero-terminated=1) gtk-doc annotations in gtkaboutdialog.c gtk 2.22.0.
Created attachment 184654 [details] [review] Get Lights Off working
Created attachment 184655 [details] [review] Enable Swell Foop (no changes needed)
Created attachment 184656 [details] [review] Install the typelib into a private location
I've been playing around with seed 2.91.90 and can get both seed games working with minor changes (see patches). I've also made the typelib be correctly installed into a private location. I've requested a freeze exception for these patches.
Edward, is the get_children patch still applicable also? It seems to run fine without it.
Created attachment 184665 [details] [review] Fix lights off settings dialog
Created attachment 184666 [details] [review] Fix swell foop settings dialog
As pointed out by Thomas the settings dialogs weren't working. Last two patches fix that.
(In reply to comment #20) > Edward, is the get_children patch still applicable also? It seems to run fine > without it. I can confirm that it's no longer necessary - presumably fixed in a more recent gobject-introspection or clutter.
Any word of the freeze break request (couldn't find it)? I want to roll a 2.91.93.1 tarball before 3.0 this Monday.
http://mail.gnome.org/archives/release-team/2011-March/msg00575.html Getting it tested would be the first step.
Review of attachment 172303 [details] [review]: Obsolete as stated by Edward
I have tested the patches and they resolve the issues I had. I still noticed: - Help is not working - Version number in about dialog is 1.0 With those two fixes I think we could enable the games again
Thomas, what happens with the help? It's working for me. The version is just as broken as it was in the previous releases (it's hard coded to 1.0, but I'll patch that too).
Help pops up a dialog with: "Could not show help for “seed” Operation not supported" Terminal shows: ** (seed:17661): WARNING **: ArgumentError - probably due to incorrect gir file (which may be fixed upstream) argument 3 must not be null for function: help_display Could be because I am running on maverick (jhbuilding) You are right about version being broken in earlier releases. Getting it fixed would be really nice :)
The warning is due to an incorrect annotation in libgames-support/games-help.c * @section: a section name, or %NULL should be: * @section: (allow-none): a section name, or %NULL It works without that fix for me. I just haven't added it here to limit the size of the patch. I don't think this is your problem, but it's worth trying. The error you're showing looks like the error from games_show_uri which should just be running gtk_show_uri. Does $ gnome-open ghelp:swell-foop work?
"gnome-open ghelp:swell-foop" fails in the jhbuild shell so it is probably not a real problem then. Thanks
Thanks, everyone.
This set of fixes was committed to stable and master. It's been released as 3.0.1 and is already in a few repositories. Thanks!