summaryrefslogtreecommitdiff
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
parent295e763b4da13726b7beb8e9c905a5af30b0e251 (diff)
downloadgdk-pixbuf-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) ]
-rw-r--r--ChangeLog16
-rw-r--r--ChangeLog.pre-2-016
-rw-r--r--ChangeLog.pre-2-1016
-rw-r--r--ChangeLog.pre-2-216
-rw-r--r--ChangeLog.pre-2-416
-rw-r--r--ChangeLog.pre-2-616
-rw-r--r--ChangeLog.pre-2-816
-rw-r--r--gdk/MwmUtil.h32
-rw-r--r--gdk/gdk.c30
-rw-r--r--gdk/gdk.h2
-rw-r--r--gdk/gdkwindow.c4
-rw-r--r--gdk/x11/MwmUtil.h32
-rw-r--r--gdk/x11/gdkmain-x11.c30
-rw-r--r--gdk/x11/gdkwindow-x11.c4
-rw-r--r--gtk/gtkmain.c23
-rw-r--r--gtk/gtkmain.h2
16 files changed, 218 insertions, 53 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-0
+++ b/ChangeLog.pre-2-0
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index 7ccbb7706..0d870f6b0 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,19 @@
+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) ]
+
+Sun Feb 21 14:46:02 1999 Owen Taylor <otaylor@redhat.com>
+
+ * gtk/gtkmain.c (gtk_init_check):
+ gdk/gdk.c (gdk_init_check):
+
+ Added initialization variants that return a status
+ instead of dying.
+
Sun Feb 21 14:21:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: removed debugging statements
diff --git a/gdk/MwmUtil.h b/gdk/MwmUtil.h
index 9f4e3a29b..53925f685 100644
--- a/gdk/MwmUtil.h
+++ b/gdk/MwmUtil.h
@@ -21,6 +21,14 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
+ *
+ * * Feb 21 1999 - George Lebl (jirka@5z.com)
+ * Owen Taylor (otaylor@redhat.com)
+ *
+ * Modified so that the MotifWmHints structure defined here
+ * is suitable for client side use on 64-bit architectures.
+ * X expects fields with a format of 32 to be longs, even
+ * when sizeof(long) == 8.
**/
#ifndef MWMUTIL_H_INCLUDED
@@ -33,11 +41,11 @@ extern "C" {
#endif
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 input_mode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
@@ -100,11 +108,11 @@ typedef MotifWmInfo MwmInfo;
* _MWM_HINTS property
*/
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 inputMode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
} PropMotifWmHints;
typedef PropMotifWmHints PropMwmHints;
@@ -116,8 +124,8 @@ typedef PropMotifWmHints PropMwmHints;
* _MWM_INFO property, slight return
*/
typedef struct {
- CARD32 flags;
- CARD32 wmWindow;
+ unsigned long flags;
+ unsigned long wmWindow;
} PropMotifWmInfo;
typedef PropMotifWmInfo PropMwmInfo;
diff --git a/gdk/gdk.c b/gdk/gdk.c
index f4d5f7b80..f10a89830 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);
+ }
}
/*
diff --git a/gdk/gdk.h b/gdk/gdk.h
index b8b84a099..113711b06 100644
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -32,6 +32,8 @@ extern "C" {
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
void gdk_init (gint *argc,
gchar ***argv);
+gboolean gdk_init_check (gint *argc,
+ gchar ***argv);
void gdk_exit (gint error_code);
gchar* gdk_set_locale (void);
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index c2b894453..32ced4397 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2131,7 +2131,7 @@ gdk_window_set_mwm_hints (GdkWindow *window,
_XA_MOTIF_WM_HINTS, FALSE);
XGetWindowProperty (window_private->xdisplay, window_private->xwindow,
- hints_atom, 0, sizeof (MotifWmHints)/4,
+ hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
@@ -2153,7 +2153,7 @@ gdk_window_set_mwm_hints (GdkWindow *window,
XChangeProperty (window_private->xdisplay, window_private->xwindow,
hints_atom, hints_atom, 32, PropModeReplace,
- (guchar *)hints, sizeof (MotifWmHints)/4);
+ (guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
if (hints != new_hints)
XFree (hints);
diff --git a/gdk/x11/MwmUtil.h b/gdk/x11/MwmUtil.h
index 9f4e3a29b..53925f685 100644
--- a/gdk/x11/MwmUtil.h
+++ b/gdk/x11/MwmUtil.h
@@ -21,6 +21,14 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
+ *
+ * * Feb 21 1999 - George Lebl (jirka@5z.com)
+ * Owen Taylor (otaylor@redhat.com)
+ *
+ * Modified so that the MotifWmHints structure defined here
+ * is suitable for client side use on 64-bit architectures.
+ * X expects fields with a format of 32 to be longs, even
+ * when sizeof(long) == 8.
**/
#ifndef MWMUTIL_H_INCLUDED
@@ -33,11 +41,11 @@ extern "C" {
#endif
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 input_mode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long input_mode;
+ unsigned long status;
} MotifWmHints, MwmHints;
#define MWM_HINTS_FUNCTIONS (1L << 0)
@@ -100,11 +108,11 @@ typedef MotifWmInfo MwmInfo;
* _MWM_HINTS property
*/
typedef struct {
- CARD32 flags;
- CARD32 functions;
- CARD32 decorations;
- INT32 inputMode;
- CARD32 status;
+ unsigned long flags;
+ unsigned long functions;
+ unsigned long decorations;
+ long inputMode;
+ unsigned long status;
} PropMotifWmHints;
typedef PropMotifWmHints PropMwmHints;
@@ -116,8 +124,8 @@ typedef PropMotifWmHints PropMwmHints;
* _MWM_INFO property, slight return
*/
typedef struct {
- CARD32 flags;
- CARD32 wmWindow;
+ unsigned long flags;
+ unsigned long wmWindow;
} PropMotifWmInfo;
typedef PropMotifWmInfo PropMwmInfo;
diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c
index f4d5f7b80..f10a89830 100644
--- a/gdk/x11/gdkmain-x11.c
+++ b/gdk/x11/gdkmain-x11.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);
+ }
}
/*
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index c2b894453..32ced4397 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -2131,7 +2131,7 @@ gdk_window_set_mwm_hints (GdkWindow *window,
_XA_MOTIF_WM_HINTS, FALSE);
XGetWindowProperty (window_private->xdisplay, window_private->xwindow,
- hints_atom, 0, sizeof (MotifWmHints)/4,
+ hints_atom, 0, sizeof (MotifWmHints)/sizeof (long),
False, AnyPropertyType, &type, &format, &nitems,
&bytes_after, (guchar **)&hints);
@@ -2153,7 +2153,7 @@ gdk_window_set_mwm_hints (GdkWindow *window,
XChangeProperty (window_private->xdisplay, window_private->xwindow,
hints_atom, hints_atom, 32, PropModeReplace,
- (guchar *)hints, sizeof (MotifWmHints)/4);
+ (guchar *)hints, sizeof (MotifWmHints)/sizeof (long));
if (hints != new_hints)
XFree (hints);
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index 8e2a2f324..e5763e519 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -166,16 +166,16 @@ gtk_check_version (guint required_major,
}
-void
-gtk_init (int *argc,
- char ***argv)
+gboolean
+gtk_init_check (int *argc,
+ char ***argv)
{
GSList *gtk_modules = NULL;
GSList *slist;
gchar *env_string = NULL;
if (gtk_initialized)
- return;
+ return TRUE;
#if 0
g_set_error_handler (gtk_error);
@@ -187,7 +187,8 @@ gtk_init (int *argc,
/* Initialize "gdk". We pass along the 'argc' and 'argv'
* parameters as they contain information that GDK uses
*/
- gdk_init (argc, argv);
+ if (!gdk_init_check (argc, argv))
+ return FALSE;
gdk_event_handler_set ((GdkEventFunc)gtk_main_do_event, NULL, NULL);
@@ -401,6 +402,18 @@ gtk_init (int *argc,
}
}
g_slist_free (gtk_modules);
+
+ return TRUE;
+}
+
+void
+gtk_init (int *argc, char ***argv)
+{
+ if (!gtk_init_check (argc, argv))
+ {
+ g_warning ("cannot open display: %s", gdk_get_display ());
+ exit(1);
+ }
}
void
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index b44489f89..2f07e6cb0 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -62,6 +62,8 @@ gchar* gtk_check_version (guint required_major,
*/
void gtk_init (int *argc,
char ***argv);
+gboolean gtk_init_check (int *argc,
+ char ***argv);
void gtk_exit (gint error_code);
gchar* gtk_set_locale (void);
gint gtk_events_pending (void);