aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-10-15 13:00:36 (EDT)
committerSilenio Quarti2012-10-15 13:00:36 (EDT)
commit7d5f16454127161499a284d38d4f95f0f3b49fdd (patch)
treee7f0dc3ca1f9cf8951e88128a5ab56e63a1942d0
parentc4443d18acafe486c4f38ea4ce880a304ba8892f (diff)
downloadrt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.zip
rt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.tar.gz
rt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.tar.bz2
Bug 391795 - [launcher][gtk] Usability: Insufficient error reporting on startup when DISPLAY is not set or not accessible
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h2
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c15
-rw-r--r--bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c2
3 files changed, 17 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
index cdff7f4..82832ac 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtk.h
@@ -25,6 +25,7 @@ struct GTK_PTRS {
void (*gtk_fixed_set_has_window) (GtkFixed *, gboolean);
GtkWidget* (*gtk_image_new_from_pixbuf)(GdkPixbuf*);
gboolean (*gtk_init_check) (int*, char***);
+ gboolean (*gtk_init_with_args) (int*, char***, const char *, GOptionEntry *, const char *, GError **);
GtkWidget* (*gtk_message_dialog_new) (GtkWindow*, GtkDialogFlags, GtkMessageType, GtkButtonsType, const gchar*, ...);
void (*gtk_scrolled_window_set_policy)(GtkScrolledWindow*, GtkPolicyType, GtkPolicyType);
GtkWidget* (*gtk_scrolled_window_new) (GtkAdjustment*, GtkAdjustment*);
@@ -45,6 +46,7 @@ struct GTK_PTRS {
void (*g_object_unref) (gpointer);
GObject* (*g_object_new) (GType, const gchar*, ...);
guint (*g_timeout_add) (guint, GSourceFunc, gpointer);
+ void (*g_error_free) (GError *);
#ifdef SOLARIS
GString* (*g_string_insert_c) (GString *, gssize, gchar);
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
index f1c611c..ebae2b8 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkCommon.c
@@ -91,8 +91,19 @@ int initWindowSystem(int* pArgc, char* argv[], int showSplash)
/* Initialize GTK. */
gtk.gtk_set_locale();
- if (!gtk.gtk_init_check(pArgc, &argv)) {
- return -1;
+ if (gtk.gtk_init_with_args) {
+ GError *error = NULL;
+ if (!gtk.gtk_init_with_args(pArgc, &argv, NULL, NULL, NULL, &error)) {
+ if (error) {
+ fprintf(stderr, "%s: %s\n", getOfficialName(), error->message);
+ if (gtk.g_error_free) gtk.g_error_free(error);
+ }
+ return -1;
+ }
+ } else {
+ if (!gtk.gtk_init_check(pArgc, &argv)) {
+ return -1;
+ }
}
/*_gdk_set_program_class(getOfficialName());*/
diff --git a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
index 787f733..8d0843f 100644
--- a/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
+++ b/bundles/org.eclipse.equinox.executable/library/gtk/eclipseGtkInit.c
@@ -26,6 +26,7 @@ static FN_TABLE gtkFunctions[] = { FN_TABLE_ENTRY(gtk_adjustment_new),
FN_TABLE_ENTRY(gtk_fixed_set_has_window),
FN_TABLE_ENTRY(gtk_image_new_from_pixbuf),
FN_TABLE_ENTRY(gtk_init_check),
+ FN_TABLE_ENTRY(gtk_init_with_args),
FN_TABLE_ENTRY(gtk_message_dialog_new),
FN_TABLE_ENTRY(gtk_scrolled_window_set_policy),
FN_TABLE_ENTRY(gtk_scrolled_window_new),
@@ -59,6 +60,7 @@ static FN_TABLE gobjFunctions[] = { FN_TABLE_ENTRY(g_log_set_handler),
FN_TABLE_ENTRY(g_main_context_iteration),
FN_TABLE_ENTRY(g_object_unref),
FN_TABLE_ENTRY(g_timeout_add),
+ FN_TABLE_ENTRY(g_error_free),
#ifdef SOLARIS
FN_TABLE_ENTRY(g_string_insert_c),
#endif