Commit 25cdbd35 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor

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) ]
parent 295e763b
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
......
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
......
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
......
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
......
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
......
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
......
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
......
......@@ -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;
......
......@@ -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);
}
}
/*
......
......@@ -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);
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
}
}
/*
......
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment