gdk/x11/gdkevents-x11.c (get_real_window) gdk/x11/gdkinput-x11.c
Tue Jul 8 20:11:04 2003 Owen Taylor <otaylor@redhat.com> * gdk/x11/gdkevents-x11.c (get_real_window) gdk/x11/gdkinput-x11.c (_gdk_input_common_init) gdk/x11/gdkimage-x11.c (_gdk_windowing_image_init) gdk/x11/gdkprivate-x11.h (_gdk_windowing_image_init) Don't assume that all events start with XEventAny - Xkb events don't! (#105745). So, only do that for core events, and for non-core events, add a system for registering event types that start with XEventAny. * gdk/x11/gdkevents-x11.c (gdk_event_translate): Check to see if the result of gdk_window_lookup_for_display() is actually a window.
This commit is contained in:
@ -195,26 +195,6 @@ gdk_image_new_bitmap(GdkVisual *visual, gpointer data, gint width, gint height)
|
||||
return(image);
|
||||
} /* gdk_image_new_bitmap() */
|
||||
|
||||
/*
|
||||
* Desc: query the server for support for the MIT_SHM extension
|
||||
* Return: 0 = not available
|
||||
* 1 = shared XImage support available
|
||||
* 2 = shared Pixmap support available also
|
||||
*/
|
||||
static int
|
||||
gdk_image_check_xshm(Display *display)
|
||||
{
|
||||
#ifdef USE_SHM
|
||||
int major, minor;
|
||||
Bool pixmaps;
|
||||
|
||||
if (XShmQueryExtension (display) &&
|
||||
XShmQueryVersion (display, &major, &minor, &pixmaps))
|
||||
return pixmaps ? 2 : 1;
|
||||
#endif /* USE_SHM */
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_windowing_image_init (GdkDisplay *display)
|
||||
{
|
||||
@ -222,12 +202,23 @@ _gdk_windowing_image_init (GdkDisplay *display)
|
||||
|
||||
if (display_x11->use_xshm)
|
||||
{
|
||||
gint res = gdk_image_check_xshm (GDK_DISPLAY_XDISPLAY (display));
|
||||
|
||||
if (!res)
|
||||
display_x11->use_xshm = False;
|
||||
#ifdef USE_SHM
|
||||
Display *xdisplay = display_x11->xdisplay;
|
||||
int major, minor, event_base;
|
||||
Bool pixmaps;
|
||||
|
||||
if (XShmQueryExtension (xdisplay) &&
|
||||
XShmQueryVersion (xdisplay, &major, &minor, &pixmaps))
|
||||
{
|
||||
display_x11->have_shm_pixmaps = pixmaps;
|
||||
event_base = XShmGetEventBase (xdisplay);
|
||||
|
||||
_gdk_x11_register_event_type (display,
|
||||
event_base, ShmNumberEvents);
|
||||
}
|
||||
else
|
||||
display_x11->have_shm_pixmaps = (res == 2);
|
||||
display_x11->use_xshm = TRUE;
|
||||
#endif /* USE_SHM */
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user