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 762054 - Fix command line processing
Fix command line processing
Status: RESOLVED FIXED
Product: gnome-nibbles
Classification: Applications
Component: general
3.19.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-nibbles-maint
gnome-nibbles-maint
Depends on:
Blocks:
 
 
Reported: 2016-02-14 23:48 UTC by Michael Catanzaro
Modified: 2016-02-19 16:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Crash if clutter initialization fails (1.35 KB, patch)
2016-02-15 05:48 UTC, Michael Catanzaro
committed Details | Review
Get rid of special handling for GTK+ and Clutter command line options (2.77 KB, patch)
2016-02-15 05:48 UTC, Michael Catanzaro
committed Details | Review
Move some logic from the Nibbles constructor to startup (1.36 KB, patch)
2016-02-15 05:48 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2016-02-14 23:48:29 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.
Comment 1 Michael Catanzaro 2016-02-15 04:56:08 UTC
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....
Comment 2 Michael Catanzaro 2016-02-15 05:48:34 UTC
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?"
Comment 3 Michael Catanzaro 2016-02-15 05:48:38 UTC
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.
Comment 4 Michael Catanzaro 2016-02-15 05:48:42 UTC
Created attachment 321187 [details] [review]
Move some logic from the Nibbles constructor to startup
Comment 5 Michael Catanzaro 2016-02-15 05:49:07 UTC
Still failed to get D-Bus activation working... but I think that's not so important....
Comment 6 Michael Catanzaro 2016-02-15 05:50:46 UTC
Erm, need to squash those last two patches before pushing....
Comment 7 Iulian Radu 2016-02-19 16:18:21 UTC
Review of attachment 321185 [details] [review]:

Right, I remember you telling me this before.
Comment 8 Iulian Radu 2016-02-19 16:23:43 UTC
Review of attachment 321186 [details] [review]:

Thanks!
Comment 9 Iulian Radu 2016-02-19 16:24:04 UTC
Review of attachment 321187 [details] [review]:

Thanks