GNOME Bugzilla – Bug 754763
gtkmm-documentation: examples/book/application/command_line_handling no longer shows a window
Last modified: 2015-09-09 15:22:27 UTC
Running the gtkmm-documentation/examples/book/application/command_line_handling example now doesn't result in a window showing. Gtk::Application::run() seems to just return, stopping the program. I noticed this same behaviour yesterday when trying to run my little prefixsuffix app. The other gtkmm-documentation/examples/book/application/ examples seem to be working OK. I guess that some part of my recent C++11 move operations changes has done this.
No, it's not related the move operations. It's because glib bug 750796 has been fixed. Gio::Application::signal_handle_local_options() now works as described: "If you have handled your options and want to exit the process, return a non-negative option, 0 for success, and a positive value for failure. To continue, return -1 to let the default option processing continue." ExampleApplication::on_handle_local_options() in gtkmm-documentation/examples/book/application/command_line_handling returns EXIT_SUCCESS, i.e. 0, and the program ends without opening a window. This is useful for processing options like --help and --version.
Thanks. So this seems to fix it: https://git.gnome.org/browse/gtkmm-documentation/commit/?id=8e44ba1a0de61d718ff903a1849fb2e9bbd05796 It would be nice if there was some generic way to output the help/usage after complaining about invalid command line parameters.