#include <X11/XKBlib.h>
#endif
+/* Although X11/Xlib.h commonly defines the types XErrorHandler and
+ XIOErrorHandler, they are not in the Xlib spec so for portability
+ define and use names with a leading lower-case 'x' instead. */
+typedef int (*xErrorHandler) (Display *, XErrorEvent *);
+typedef int (*xIOErrorHandler) (Display *);
+
#if defined USE_XCB && defined USE_CAIRO_XCB
#define USE_CAIRO_XCB_SURFACE
#endif
Window drag_window;
XSetWindowAttributes attrs;
Display *temp_display;
- void *old_handler, *old_io_handler;
+ xErrorHandler old_handler;
+ xIOErrorHandler old_io_handler;
+
/* These are volatile because GCC mistakenly warns about them being
clobbered by longjmp. */
volatile bool error, created;
XGrabServer (temp_display);
XSetCloseDownMode (temp_display, RetainPermanent);
- /* We can't use XErrorHandler since it's not in the Xlib
- specification, and Emacs tries to be portable. */
- old_handler = (void *) XSetErrorHandler (xm_drag_window_error_handler);
+ old_handler = XSetErrorHandler (xm_drag_window_error_handler);
_MOTIF_DRAG_WINDOW = XInternAtom (temp_display,
"_MOTIF_DRAG_WINDOW", False);
bool
x_detect_pending_selection_requests (void)
{
- return pending_selection_requests;
+ return !!pending_selection_requests;
}
static void
> x_error_message->first_request))
XSync (dpy, False);
- return x_error_message->string;
+ return !!x_error_message->string;
}
/* Forget about any errors we have had, since we did x_catch_errors on
struct x_display_info *dpyinfo;
Lisp_Object frame, tail;
specpdl_ref idx = SPECPDL_INDEX ();
- void *io_error_handler;
+ xIOErrorHandler io_error_handler;
xm_drop_start_message dmsg;
struct frame *f;
if (xim)
{
-#ifdef HAVE_X11R6
+#ifdef HAVE_X11R6_XIM
XIMCallback destroy;
#endif
/* Get supported styles and XIM values. */
XGetIMValues (xim, XNQueryInputStyle, &dpyinfo->xim_styles, NULL);
-#ifdef HAVE_X11R6
+#ifdef HAVE_X11R6_XIM
destroy.callback = xim_destroy_callback;
destroy.client_data = (XPointer)dpyinfo;
XSetIMValues (xim, XNDestroyCallback, &destroy, NULL);