GNOME Bugzilla – Bug 762054
Fix command line processing
Last modified: 2016-02-19 16:26:48 UTC
Need to figure out why command line options like --version are not working. Then we can revert my revert of the commit where I attempt to make Nibbles D-Bus activatable.
I was really stumped until I discovered the custom command line handling in main. You create an OptionContext there with only the standard GTK+ and Clutter options, and parse it there. It presumably eats all the options like --version and --gapplication-service so there's nothing left for the Nibbles GtkApplication's OptionsContext. We shouldn't be creating two OptionsContexts anyway. I remember squinting at this last summer, but I probably decided "whatever, if it works." Let's see if it's possible to remove that code....
Created attachment 321185 [details] [review] Crash if clutter initialization fails This way we trigger distro bug report tools, rather than leaving users to wonder "what's clutter?"
Created attachment 321186 [details] [review] Get rid of special handling for GTK+ and Clutter command line options Nowadays the best practice is to ignore GTK+ command line options and just use environment variables instead. (This is what GtkApplication does; it doesn't actually pass any of the options to gtk_init. It's a bit buggy, though, as the options still appear in help for some reason, but that's not our fault.) Treat the Clutter options the same way. If these options provide any functionality not accessible via environment variables, Clutter should be enhanced. Accordingly, move this functionality out of main, and into startup() where it really belongs.
Created attachment 321187 [details] [review] Move some logic from the Nibbles constructor to startup
Still failed to get D-Bus activation working... but I think that's not so important....
Erm, need to squash those last two patches before pushing....
Review of attachment 321185 [details] [review]: Right, I remember you telling me this before.
Review of attachment 321186 [details] [review]: Thanks!
Review of attachment 321187 [details] [review]: Thanks