configure.in acheader.h gdk/gdkwindow.c Check for Shape extension both on

Sun May  3 13:38:22 1998  Owen Taylor  <otaylor@gtk.org>

	* configure.in acheader.h gdk/gdkwindow.c
	Check for Shape extension both on the client and server
	side. (And, more importantly, check for the shape extension
	so we may include -lXext even when compiling with --disable-xshm)

	Don't set override_redirect on all shaped windows. It isn't
	necessary.

	* gdk/gdkwindow.c: Set ->colormap to NULL for root
	and foreign windows. Use this to check if we
	need to get the colormap from X.

Fri May  1 22:32:47 1998  Owen Taylor  <otaylor@gtk.org>

	* gtk/gtkbutton.c (gtk_button_paint): Draw the areas
	between the default and the button always in GTK_STATE_NORMAL.

	* gtk/gtkrange.c (gtk_range_style_set): Added a style_set
	callback.

Fri May  1 16:40:57 1998  Owen Taylor  <otaylor@gtk.org>

	* gdk/gdkpixmap.c (gdk_pixmap_colormap_create_from_xpmp[_d]):
	  Fix a buffer overflow on pixmaps that claim to have
	  more than 31 characters per pixel.

	  (gdk_pixmap_read_string): Don't wrap around strings longer
 	  than half of address space ;-)

	* gtk/gtk[vh]ruler.c gtk/gtkinputdialog.c: Expand some buffers
	that were used for printing integers.

	* */* (almost):

	Style: All
	  int foo () { ... }
	changed to
	  int foo (void) { ... }

^^^^^^^ This is why some many files changed

	Even where there were proper prototypes elsewhere.

	* gdk/gxid.c (handle_claim_device): Some extra checks.
	It isn't safe against being fed bad X id's, but at
	least it should be safe against deleting all your
	files.
This commit is contained in:
Owen Taylor
1998-05-03 22:41:32 +00:00
committed by Owen Taylor
parent c0b9232351
commit 4851efe296
125 changed files with 1192 additions and 475 deletions

View File

@ -20,7 +20,6 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/shape.h>
#include <netinet/in.h>
#include "gdk.h"
#include "../config.h"
@ -30,6 +29,10 @@
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_SHAPE_EXT
#include <X11/extensions/shape.h>
#endif
int nevent_masks = 17;
int event_mask_table[19] =
{
@ -172,7 +175,7 @@ gdk_window_xid_at_coords(gint x, gint y, GList *excludes, gboolean excl_child)
}
void
gdk_window_init ()
gdk_window_init (void)
{
XWindowAttributes xattributes;
unsigned int width;
@ -192,6 +195,7 @@ gdk_window_init ()
gdk_root_parent.width = width;
gdk_root_parent.height = height;
gdk_root_parent.children = NULL;
gdk_root_parent.colormap = NULL;
}
GdkWindow*
@ -472,6 +476,7 @@ gdk_window_foreign_new (guint32 anid)
private->destroyed = FALSE;
private->extension_events = 0;
private->colormap = NULL;
private->dnd_drag_data_type = None;
private->dnd_drag_data_typesavail =
@ -1195,8 +1200,7 @@ gdk_window_get_visual (GdkWindow *window)
if (window_private && !window_private->destroyed)
{
if ((window_private->window_type == GDK_WINDOW_FOREIGN)||
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
if (window_private->colormap == NULL)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
@ -1222,8 +1226,7 @@ gdk_window_get_colormap (GdkWindow *window)
g_return_val_if_fail (window_private->window_type != GDK_WINDOW_PIXMAP, NULL);
if (!window_private->destroyed)
{
if ((window_private->window_type == GDK_WINDOW_FOREIGN)||
(window_private->xwindow==DefaultRootWindow(window_private->xdisplay)))
if (window_private->colormap == NULL)
{
XGetWindowAttributes (window_private->xdisplay,
window_private->xwindow,
@ -1479,8 +1482,7 @@ gdk_window_add_colormap_windows (GdkWindow *window)
/*
* This needs the X11 shape extension.
* If not available, simply remove the call to
* XShapeCombineMask. Shaped windows will look
* If not available, shaped windows will look
* ugly, but programs still work. Stefan Wille
*/
void
@ -1488,38 +1490,53 @@ gdk_window_shape_combine_mask (GdkWindow *window,
GdkBitmap *mask,
gint x, gint y)
{
enum { UNKNOWN, NO, YES };
static gint have_shape = UNKNOWN;
GdkWindowPrivate *window_private;
Pixmap pixmap;
g_return_if_fail (window != NULL);
/* This is needed, according to raster */
gdk_window_set_override_redirect(window, TRUE);
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
#ifdef HAVE_SHAPE_EXT
if (have_shape == UNKNOWN)
{
GdkWindowPrivate *pixmap_private;
pixmap_private = (GdkWindowPrivate*) mask;
pixmap = (Pixmap) pixmap_private->xwindow;
int ignore;
if (XQueryExtension(gdk_display, "SHAPE", &ignore, &ignore, &ignore))
have_shape = YES;
else
have_shape = NO;
}
else
if (have_shape == YES)
{
x = 0;
y = 0;
pixmap = None;
window_private = (GdkWindowPrivate*) window;
if (window_private->destroyed)
return;
if (mask)
{
GdkWindowPrivate *pixmap_private;
pixmap_private = (GdkWindowPrivate*) mask;
pixmap = (Pixmap) pixmap_private->xwindow;
}
else
{
x = 0;
y = 0;
pixmap = None;
}
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
}
XShapeCombineMask (window_private->xdisplay,
window_private->xwindow,
ShapeBounding,
x, y,
pixmap,
ShapeSet);
#endif /* HAVE_SHAPE_EXT */
}
void