I'm creating a gtk app like this:
Glib::RefPtr<Gtk::Application> app;
try {
app = Gtk::Application::create(argc, argv, "loocal.testgtk",
Gio::APPLICATION_HANDLES_COMMAND_LINE);
}
catch (...) {
....
}
If the X server isn't there (isn't reachable) the process is aborted, the catch(...)
part is never executed.
Q: Is there a way prevent abort and to catch this exception - and e.g. retry or connect to a fall-back display?
Also: Is there a way to catch the exception when the connection with the X server breaks - in order to (try to) restart the GUI part of the application and reconnect to the X server or to a fall-back X server?