Commit 6cff7051 authored by Owen Taylor's avatar Owen Taylor Committed by Owen Taylor
Browse files

Try changing mode on shm segments to 0600. We'll see who complains.

Wed Apr 18 14:23:14 2001  Owen Taylor  <otaylor@redhat.com>

	* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
	mode on shm segments to 0600. We'll see who complains.

	* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
	_gdk_windowing_window_destroy() AFTER recursing through
	children.

	* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
	testsocket_child on X.

	* tests/testsocket[_child].c: Fix uses of
	gtk_window_get_default_accel_group().

	[ Merge patch from Ramiro Estrugo  <ramiro@eazel.com> from gtk-1-2 ]

	* gdk/gdkimage.c: (gdk_image_get):
	Deal with the possibility that XGetImage() might return NULL.
	Allocate the GdkImagePrivate structure only after XGetImage()
	succeeds in order not to dereference a NULL ximage pointer.  This
	prevents a core dump when XGetImage() fails - which is unlikely,
	but can happen due to race conditions accessing the geometries of
	drawables.  An x error will still be triggered, but the gdk image
	wrapper at least wont seg fault.
parent 60b6a010
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
Wed Apr 18 14:23:14 2001 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkimage-x11.c (gdk_image_new): Try changing
mode on shm segments to 0600. We'll see who complains.
* gdk/gdkwindow.c (_gdk_window_destroy_hierarchy): Call
_gdk_windowing_window_destroy() AFTER recursing through
children.
* tests/Makefile.am (noinst_PROGRAMS): Build testsocket,
testsocket_child on X.
* tests/testsocket[_child].c: Fix uses of
gtk_window_get_default_accel_group().
[ Merge patch from Ramiro Estrugo <ramiro@eazel.com> from gtk-1-2 ]
* gdk/gdkimage.c: (gdk_image_get):
Deal with the possibility that XGetImage() might return NULL.
Allocate the GdkImagePrivate structure only after XGetImage()
succeeds in order not to dereference a NULL ximage pointer. This
prevents a core dump when XGetImage() fails - which is unlikely,
but can happen due to race conditions accessing the geometries of
drawables. An x error will still be triggered, but the gdk image
wrapper at least wont seg fault.
2001-04-18 Havoc Pennington <hp@redhat.com>
* gtk/gtkimage.c: fix to properly queue resizes when the image is
......
......@@ -295,8 +295,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
private->state |= GDK_WINDOW_STATE_WITHDRAWN;
private->destroyed = TRUE;
_gdk_windowing_window_destroy (window, recursing, foreign_destroy);
if (private->parent)
{
GdkWindowObject *parent_private = (GdkWindowObject *)private->parent;
......@@ -333,6 +331,8 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
g_list_free (children);
}
_gdk_windowing_window_destroy (window, recursing, foreign_destroy);
if (private->filters)
{
tmp = private->filters;
......
......@@ -180,7 +180,8 @@ struct _GdkWindowAttr
gboolean override_redirect;
};
struct _GdkGeometry {
struct _GdkGeometry
{
gint min_width;
gint min_height;
gint max_width;
......
......@@ -256,13 +256,13 @@ gdk_image_new (GdkImageType type,
x_shm_info->shmid = shmget (IPC_PRIVATE,
private->ximage->bytes_per_line * private->ximage->height,
IPC_CREAT | 0777);
IPC_CREAT | 0600);
if (x_shm_info->shmid == -1)
{
/* EINVAL indicates, most likely, that the segment we asked for
* is bigger than SHMMAX, so we don't treat it as a permanently
* fatal error. ENOSPC and ENOMEM may also indicate this, but
* is bigger than SHMMAX, so we don't treat it as a permanent
* error. ENOSPC and ENOMEM may also indicate this, but
* more likely are permanent errors.
*/
if (errno != EINVAL)
......@@ -381,7 +381,8 @@ _gdk_x11_get_image (GdkDrawable *drawable,
GdkImagePrivateX11 *private;
GdkDrawableImplX11 *impl;
GdkVisual *visual;
XImage *ximage;
g_return_val_if_fail (GDK_IS_DRAWABLE_IMPL_X11 (drawable), NULL);
visual = gdk_drawable_get_visual (drawable);
......@@ -398,14 +399,19 @@ _gdk_x11_get_image (GdkDrawable *drawable,
impl = GDK_DRAWABLE_IMPL_X11 (drawable);
ximage = XGetImage (impl->xdisplay,
impl->xid,
x, y, width, height,
AllPlanes, ZPixmap);
if (!ximage)
return NULL;
image = g_object_new (gdk_image_get_type (), NULL);
private = PRIVATE_DATA (image);
private->xdisplay = gdk_display;
private->ximage = XGetImage (private->xdisplay,
impl->xid,
x, y, width, height,
AllPlanes, ZPixmap);
private->ximage = ximage;
image->type = GDK_IMAGE_NORMAL;
image->visual = visual;
......
......@@ -30,6 +30,11 @@ LDADDS = @STRIP_BEGIN@ \
-lm \
@STRIP_END@
if USE_X11
testsocket_programs = testsocket testsocket_child
endif
noinst_PROGRAMS = \
simple \
testcalendar \
......@@ -38,8 +43,7 @@ noinst_PROGRAMS = \
testinput \
testrgb \
testselection \
## testsocket \
## testsocket_child \
$(testsocket_programs) \
testtext \
testtextbuffer \
testtreeview \
......@@ -48,8 +52,6 @@ noinst_PROGRAMS = \
testtreesort \
treestoretest
#testsocket_DEPENDENCIES = $(DEPS)
#testsocket_child_DEPENDENCIES = $(DEPS)
simple_DEPENDENCIES = $(TEST_DEPS)
testcalendar_DEPENDENCIES = $(TEST_DEPS)
testdnd_DEPENDENCIES = $(TEST_DEPS)
......@@ -57,6 +59,8 @@ testgtk_DEPENDENCIES = $(TEST_DEPS)
testinput_DEPENDENCIES = $(TEST_DEPS)
testrgb_DEPENDENCIES = $(TEST_DEPS)
testselection_DEPENDENCIES = $(TEST_DEPS)
testsocket_DEPENDENCIES = $(DEPS)
testsocket_child_DEPENDENCIES = $(DEPS)
testtext_DEPENDENCIES = $(TEST_DEPS)
testtextbuffer_DEPENDENCIES = $(TEST_DEPS)
testtreeview_DEPENDENCIES = $(DEPS)
......@@ -65,8 +69,6 @@ testtreecolumns_DEPENDENCIES = $(DEPS)
testtreesort_DEPENDENCIES = $(DEPS)
treestoretest_DEPENDENCIES = $(TEST_DEPS)
#testsocket_LDADD = $(LDADDS)
#testsocket_child_LDADD = $(LDADDS)
simple_LDADD = $(LDADDS)
testcalendar_LDADD = $(LDADDS)
testdnd_LDADD = $(LDADDS)
......@@ -74,6 +76,8 @@ testgtk_LDADD = $(LDADDS)
testinput_LDADD = $(LDADDS)
testrgb_LDADD = $(LDADDS)
testselection_LDADD = $(LDADDS)
testsocket_LDADD = $(LDADDS)
testsocket_child_LDADD = $(LDADDS)
testtextbuffer_LDADD = $(LDADDS)
testtreeview_LDADD = $(LDADDS)
testtreefocus_LDADD = $(LDADDS)
......
......@@ -97,6 +97,7 @@ main (int argc, char *argv[])
GtkWidget *button;
GtkWidget *hbox;
GtkWidget *entry;
GtkAccelGroup *accel_group;
GtkItemFactory *item_factory;
gtk_init (&argc, &argv);
......@@ -111,8 +112,11 @@ main (int argc, char *argv[])
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), vbox);
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>",
gtk_window_get_default_accel_group (GTK_WINDOW (window)));
accel_group = gtk_accel_group_new ();
gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
gtk_item_factory_create_items (item_factory,
G_N_ELEMENTS (menu_items), menu_items,
NULL);
......
......@@ -16,9 +16,8 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
GtkWidget *add_button;
GtkWidget *remove_button;
GtkWidget *toplevel = gtk_widget_get_toplevel (box);
GtkAccelGroup *accel_group = gtk_window_get_default_accel_group (GTK_WINDOW (toplevel));
add_button = gtk_button_new_accel ("_Add", accel_group);
add_button = gtk_button_new_with_mnemonic ("_Add");
gtk_box_pack_start (GTK_BOX (box), add_button, TRUE, TRUE, 0);
gtk_widget_show (add_button);
......@@ -26,7 +25,7 @@ add_buttons (GtkWidget *widget, GtkWidget *box)
GTK_SIGNAL_FUNC (add_buttons),
box);
remove_button = gtk_button_new_accel ("_Remove", accel_group);
remove_button = gtk_button_new_with_mnemonic ("_Remove");
gtk_box_pack_start (GTK_BOX (box), remove_button, TRUE, TRUE, 0);
gtk_widget_show (remove_button);
......@@ -44,7 +43,6 @@ main (int argc, char *argv[])
GtkWidget *hbox;
GtkWidget *entry;
GtkWidget *button;
GtkAccelGroup *accel_group;
gtk_init (&argc, &argv);
if (argc < 2)
......@@ -73,9 +71,7 @@ main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);
gtk_widget_show (entry);
accel_group = gtk_window_get_default_accel_group (GTK_WINDOW (window));
button = gtk_button_new_accel ("_Close", accel_group);
button = gtk_button_new_with_mnemonic ("_Close");
gtk_box_pack_start (GTK_BOX (hbox), button, TRUE, TRUE, 0);
gtk_widget_show (button);
......
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