Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2012-10-15 17:00:36 +0000
committerSilenio Quarti2012-10-15 17:00:36 +0000
commit7d5f16454127161499a284d38d4f95f0f3b49fdd (patch)
treee7f0dc3ca1f9cf8951e88128a5ab56e63a1942d0
parentc4443d18acafe486c4f38ea4ce880a304ba8892f (diff)
downloadrt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.tar.gz
rt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.tar.xz
rt.equinox.framework-7d5f16454127161499a284d38d4f95f0f3b49fdd.zip
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 cdff7f437..82832acbe 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 f1c611cd7..ebae2b83a 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 787f73395..8d0843f9c 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

Back to the top