summaryrefslogtreecommitdiff
path: root/gdk/gdk.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1999-02-21 20:55:04 +0000
committerOwen Taylor <otaylor@src.gnome.org>1999-02-21 20:55:04 +0000
commit25cdbd356057a4e8d3a654487a739a279fa96068 (patch)
treef55f54f575c9e3502639460a09e69ae84c8dd643 /gdk/gdk.c
parent295e763b4da13726b7beb8e9c905a5af30b0e251 (diff)
downloadgtk+-25cdbd356057a4e8d3a654487a739a279fa96068.tar.gz
Account for the fact that Xlib expects format == 32 to be a long, even on
Sun Feb 21 15:59:55 1999 Owen Taylor <otaylor@redhat.com> * gdk/MwmUtil.h gdk/gdkwindow.c: Account for the fact that Xlib expects format == 32 to be a long, even on 64-bit architectures. [ patch from George Lebl (jirka@5z.com) ]
Diffstat (limited to 'gdk/gdk.c')
-rw-r--r--gdk/gdk.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index f4d5f7b808..f10a898308 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -124,7 +124,7 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
/*
*--------------------------------------------------------------
- * gdk_init
+ * gdk_init_heck
*
* Initialize the library for use.
*
@@ -135,7 +135,8 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
* Results:
* "argc" and "argv" are modified to reflect any arguments
* which were not handled. (Such arguments should either
- * be handled by the application or dismissed).
+ * be handled by the application or dismissed). If initialization
+ * fails, returns FALSE, otherwise TRUE.
*
* Side effects:
* The library is initialized.
@@ -143,9 +144,9 @@ static const int gdk_ndebug_keys = sizeof(gdk_debug_keys)/sizeof(GDebugKey);
*--------------------------------------------------------------
*/
-void
-gdk_init (int *argc,
- char ***argv)
+gboolean
+gdk_init_check (int *argc,
+ char ***argv)
{
XKeyboardState keyboard_state;
gint synchronize;
@@ -155,7 +156,7 @@ gdk_init (int *argc,
gint argc_orig = 0;
if (gdk_initialized)
- return;
+ return TRUE;
if (g_thread_supported ())
gdk_threads_mutex = g_mutex_new ();
@@ -370,10 +371,7 @@ gdk_init (int *argc,
gdk_display = XOpenDisplay (gdk_display_name);
if (!gdk_display)
- {
- g_warning ("cannot open display: %s", XDisplayName (gdk_display_name));
- exit(1);
- }
+ return FALSE;
if (synchronize)
XSynchronize (gdk_display, True);
@@ -428,6 +426,18 @@ gdk_init (int *argc,
#endif
gdk_initialized = 1;
+
+ return TRUE;
+}
+
+void
+gdk_init (int *argc, char ***argv)
+{
+ if (!gdk_init_check (argc, argv))
+ {
+ g_warning ("cannot open display: %s", gdk_get_display ());
+ exit(1);
+ }
}
/*