#include <config.h>
#include <stdio.h>
#include <math.h>
-#include <setjmp.h>
#include <unistd.h>
/* This makes the fields of a Display accessible, in Xlib header files. */
unsigned char *tmp_data = NULL;
Atom target_type = XA_CARDINAL;
- BLOCK_INPUT;
+ block_input ();
x_catch_errors (dpy);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
if (had_errors) return;
Display *dpy = FRAME_X_DISPLAY (f);
Colormap cmap = FRAME_X_COLORMAP (f);
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_GTK
success_p = xg_check_special_colors (f, color_name, color);
#endif
success_p = XParseColor (dpy, cmap, color_name, color);
if (success_p && alloc_p)
success_p = x_alloc_nearest_color (f, cmap, color);
- UNBLOCK_INPUT;
+ unblock_input ();
return success_p;
}
GdkPixbuf *pixbuf;
GError *err = NULL;
char *filename = SSDATA (found);
- BLOCK_INPUT;
+ block_input ();
pixbuf = gdk_pixbuf_new_from_file (filename, &err);
else
g_error_free (err);
- UNBLOCK_INPUT;
+ unblock_input ();
}
return result;
{
Display *dpy = FRAME_X_DISPLAY (f);
- BLOCK_INPUT;
+ block_input ();
XSetForeground (dpy, x->normal_gc, fg);
XSetBackground (dpy, x->reverse_gc, fg);
XSetBackground (dpy, x->cursor_gc, x->cursor_pixel);
}
- UNBLOCK_INPUT;
+ unblock_input ();
update_face_from_frame_parameter (f, Qforeground_color, arg);
{
Display *dpy = FRAME_X_DISPLAY (f);
- BLOCK_INPUT;
+ block_input ();
XSetBackground (dpy, x->normal_gc, bg);
XSetForeground (dpy, x->reverse_gc, bg);
XSetWindowBackground (dpy, FRAME_X_WINDOW (f), bg);
}
#endif /* USE_TOOLKIT_SCROLL_BARS */
- UNBLOCK_INPUT;
+ unblock_input ();
update_face_from_frame_parameter (f, Qbackground_color, arg);
if (FRAME_VISIBLE_P (f))
unload_color (f, x->mouse_pixel);
x->mouse_pixel = pixel;
- BLOCK_INPUT;
+ block_input ();
/* It's not okay to crash if the user selects a screwy cursor. */
x_catch_errors (dpy);
x->horizontal_drag_cursor = horizontal_drag_cursor;
XFlush (dpy);
- UNBLOCK_INPUT;
+ unblock_input ();
update_face_from_frame_parameter (f, Qmouse_color, arg);
}
if (FRAME_X_WINDOW (f) != 0)
{
- BLOCK_INPUT;
+ block_input ();
XSetBackground (FRAME_X_DISPLAY (f), x->cursor_gc, x->cursor_pixel);
XSetForeground (FRAME_X_DISPLAY (f), x->cursor_gc, fore_pixel);
- UNBLOCK_INPUT;
+ unblock_input ();
if (FRAME_VISIBLE_P (f))
{
if (FRAME_X_WINDOW (f) != 0 && f->border_width > 0)
{
- BLOCK_INPUT;
+ block_input ();
XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), pix);
- UNBLOCK_INPUT;
+ unblock_input ();
if (FRAME_VISIBLE_P (f))
redraw_frame (f);
else if (!STRINGP (oldval) && EQ (oldval, Qnil) == EQ (arg, Qnil))
return;
- BLOCK_INPUT;
+ block_input ();
if (NILP (arg))
result = x_text_icon (f,
SSDATA ((!NILP (f->icon_name)
if (result)
{
- UNBLOCK_INPUT;
+ unblock_input ();
error ("No icon window available");
}
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
static void
if (f->output_data.x->icon_bitmap != 0)
return;
- BLOCK_INPUT;
+ block_input ();
result = x_text_icon (f,
SSDATA ((!NILP (f->icon_name)
if (result)
{
- UNBLOCK_INPUT;
+ unblock_input ();
error ("No icon window available");
}
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
\f
{
y = FRAME_TOP_MARGIN_HEIGHT (f);
- BLOCK_INPUT;
+ block_input ();
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
0, y, width, height, False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (nlines > 1 && nlines > olines)
y = (olines == 0 ? 1 : olines) * FRAME_LINE_HEIGHT (f);
height = nlines * FRAME_LINE_HEIGHT (f) - y;
- BLOCK_INPUT;
+ block_input ();
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
0, y, width, height, False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (nlines == 0 && WINDOWP (f->menu_bar_window))
/* height can be zero here. */
if (height > 0 && width > 0)
{
- BLOCK_INPUT;
+ block_input ();
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
0, y, width, height, False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (WINDOWP (f->tool_bar_window))
{
if (FRAME_X_WINDOW (f))
{
- BLOCK_INPUT;
+ block_input ();
{
XTextProperty text, icon;
ptrdiff_t bytes;
if (do_free_text_value)
xfree (text.value);
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
int need_focus = 1;
int need_save = 1;
- BLOCK_INPUT;
+ block_input ();
{
Atom type;
unsigned char *catoms;
XA_ATOM, 32, PropModeAppend,
(unsigned char *) props, count);
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif
Arg al [25];
int ac;
- BLOCK_INPUT;
+ block_input ();
/* Use the resource name as the top-level widget name
for looking up resources. Make a non-Lisp copy
f->output_data.x->current_cursor
= f->output_data.x->text_cursor);
- UNBLOCK_INPUT;
+ unblock_input ();
/* This is a no-op, except under Motif. Make sure main areas are
set to something reasonable, in case we get an error later. */
FRAME_XIC (f) = NULL;
if (use_xim)
{
- BLOCK_INPUT;
+ block_input ();
create_frame_xic (f);
if (FRAME_XIC (f))
{
attribute_mask, &attributes);
}
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif
}
attribute_mask = (CWBackPixel | CWBorderPixel | CWBitGravity | CWEventMask
| CWColormap);
- BLOCK_INPUT;
+ block_input ();
FRAME_X_WINDOW (f)
= XCreateWindow (FRAME_X_DISPLAY (f),
f->output_data.x->parent_desc,
f->output_data.x->current_cursor
= f->output_data.x->text_cursor);
- UNBLOCK_INPUT;
+ unblock_input ();
if (FRAME_X_WINDOW (f) == 0)
error ("Unable to create window");
else if (!EQ (icon_x, Qunbound) || !EQ (icon_y, Qunbound))
error ("Both left and top icon corners of icon must be specified");
- BLOCK_INPUT;
+ block_input ();
if (! EQ (icon_x, Qunbound))
x_wm_set_icon_position (f, XINT (icon_x), XINT (icon_y));
? f->icon_name
: f->name)));
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Make the GCs needed for this window, setting the
{
XGCValues gc_values;
- BLOCK_INPUT;
+ block_input ();
/* Create the GCs of this frame.
Note that many default values are used. */
FRAME_BACKGROUND_PIXEL (f),
DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f))));
- UNBLOCK_INPUT;
+ unblock_input ();
}
{
Display *dpy = FRAME_X_DISPLAY (f);
- BLOCK_INPUT;
+ block_input ();
if (f->output_data.x->normal_gc)
{
f->output_data.x->border_tile = 0;
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (NILP (frame))
frame = selected_frame;
f = XFRAME (frame);
- BLOCK_INPUT;
+ block_input ();
if (FRAME_X_P (f))
x_wm_set_size_hint (f, 0, 0);
- UNBLOCK_INPUT;
+ unblock_input ();
return Qnil;
}
/* Tell the server what size and position, etc, we want, and how
badly we want them. This should be done after we have the menu
bar so that its size can be taken into account. */
- BLOCK_INPUT;
+ block_input ();
x_wm_set_size_hint (f, window_prompting, 0);
- UNBLOCK_INPUT;
+ unblock_input ();
/* Make the window appear on the frame and enable display, unless
the caller says not to. However, with explicit parent, Emacs
}
}
- BLOCK_INPUT;
+ block_input ();
/* Set machine name and pid for the purpose of window managers. */
set_machine_and_pid_properties (f);
(unsigned char *) &dpyinfo->client_leader_window, 1);
}
- UNBLOCK_INPUT;
+ unblock_input ();
/* Initialize `default-minibuffer-frame' in case this is the first
frame on this terminal. */
struct frame *f = check_x_frame (frame);
Display *dpy = FRAME_X_DISPLAY (f);
- BLOCK_INPUT;
+ block_input ();
x_catch_errors (dpy);
if (FRAME_X_EMBEDDED_P (f))
}
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return Qnil;
}
void
x_sync (FRAME_PTR f)
{
- BLOCK_INPUT;
+ block_input ();
XSync (FRAME_X_DISPLAY (f), False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
\f
nelements = SBYTES (value);
}
- BLOCK_INPUT;
+ block_input ();
prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False);
if (! NILP (type))
{
/* Make sure the property is set when we return. */
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
return value;
}
Atom prop_atom;
CHECK_STRING (prop);
- BLOCK_INPUT;
+ block_input ();
prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False);
XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom);
/* Make sure the property is removed when we return. */
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
return prop;
}
target_window = FRAME_X_DISPLAY_INFO (f)->root_window;
}
- BLOCK_INPUT;
+ block_input ();
if (STRINGP (type))
{
if (strcmp ("AnyPropertyType", SSDATA (type)) == 0)
if (tmp_data) XFree (tmp_data);
}
- UNBLOCK_INPUT;
+ unblock_input ();
UNGCPRO;
return prop_value;
}
{
Lisp_Object rest, frame;
- BLOCK_INPUT;
+ block_input ();
FOR_EACH_FRAME (rest, frame)
{
}
hourglass_shown_p = 1;
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
{
Lisp_Object rest, frame;
- BLOCK_INPUT;
+ block_input ();
FOR_EACH_FRAME (rest, frame)
{
struct frame *f = XFRAME (frame);
}
hourglass_shown_p = 0;
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
unsigned long mask;
Atom type = FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type_tooltip;
- BLOCK_INPUT;
+ block_input ();
mask = CWBackPixel | CWOverrideRedirect | CWEventMask;
if (DoesSaveUnders (dpyinfo->screen))
mask |= CWSaveUnder;
FRAME_X_DISPLAY_INFO (f)->Xatom_net_window_type,
XA_ATOM, 32, PropModeReplace,
(unsigned char *)&type, 1);
- UNBLOCK_INPUT;
+ unblock_input ();
}
x_make_gc (f);
show it. */
if (!INTEGERP (left) || !INTEGERP (top))
{
- BLOCK_INPUT;
+ block_input ();
XQueryPointer (FRAME_X_DISPLAY (f), FRAME_X_DISPLAY_INFO (f)->root_window,
&root, &child, root_x, root_y, &win_x, &win_y, &pmask);
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (INTEGERP (top))
/* Hide a previous tip, if any. */
Fx_hide_tip ();
- BLOCK_INPUT;
+ block_input ();
if ((ok = xg_prepare_tooltip (f, string, &width, &height)) != 0)
{
compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
/* This is used in Fx_hide_tip. */
XSETFRAME (tip_frame, f);
}
- UNBLOCK_INPUT;
+ unblock_input ();
if (ok) goto start_timer;
}
#endif /* USE_GTK */
call1 (Qcancel_timer, timer);
}
- BLOCK_INPUT;
+ block_input ();
compute_tip_xy (tip_f, parms, dx, dy, FRAME_PIXEL_WIDTH (tip_f),
FRAME_PIXEL_HEIGHT (tip_f), &root_x, &root_y);
XMoveWindow (FRAME_X_DISPLAY (tip_f), FRAME_X_WINDOW (tip_f),
root_x, root_y);
- UNBLOCK_INPUT;
+ unblock_input ();
goto start_timer;
}
}
show it. */
compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
- BLOCK_INPUT;
+ block_input ();
XMoveResizeWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
root_x, root_y, width, height);
XMapRaised (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
- UNBLOCK_INPUT;
+ unblock_input ();
/* Draw into the window. */
w->must_be_updated_p = 1;
if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen)
&& w != NULL)
{
- BLOCK_INPUT;
+ block_input ();
xlwmenu_redisplay (w);
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
#endif /* USE_LUCID */
Widget dialog = (Widget) p->pointer;
/* Clean up. */
- BLOCK_INPUT;
+ block_input ();
XtUnmanageChild (dialog);
XtDestroyWidget (dialog);
x_menu_set_in_use (0);
- UNBLOCK_INPUT;
+ unblock_input ();
return Qnil;
}
/* Prevent redisplay. */
specbind (Qinhibit_redisplay, Qt);
- BLOCK_INPUT;
+ block_input ();
/* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */
else
file = Qnil;
- UNBLOCK_INPUT;
+ unblock_input ();
UNGCPRO;
/* Make "Cancel" equivalent to C-g. */
specbind (Qinhibit_redisplay, Qt);
record_unwind_protect (clean_up_dialog, Qnil);
- BLOCK_INPUT;
+ block_input ();
if (STRINGP (default_filename))
cdef_file = SSDATA (default_filename);
xfree (fn);
}
- UNBLOCK_INPUT;
+ unblock_input ();
UNGCPRO;
/* Make "Cancel" equivalent to C-g. */
specbind (Qinhibit_redisplay, Qt);
record_unwind_protect (clean_up_dialog, Qnil);
- BLOCK_INPUT;
+ block_input ();
GCPRO2 (font_param, font);
font = xg_get_font (f, default_name);
xfree (default_name);
- UNBLOCK_INPUT;
+ unblock_input ();
if (NILP (font))
Fsignal (Qquit, Qnil);
Lisp_Object have_keys;
int major, minor, op, event, error_code;
- BLOCK_INPUT;
+ block_input ();
/* Check library version in case we're dynamically linked. */
major = XkbMajorVersion;
minor = XkbMinorVersion;
if (!XkbLibraryVersion (&major, &minor))
{
- UNBLOCK_INPUT;
+ unblock_input ();
return Qlambda;
}
minor = XkbMinorVersion;
if (!XkbQueryExtension (dpy, &op, &event, &error_code, &major, &minor))
{
- UNBLOCK_INPUT;
+ unblock_input ();
return Qlambda;
}
&& XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode)
have_keys = Qt;
}
- UNBLOCK_INPUT;
+ unblock_input ();
return have_keys;
#else /* not HAVE_XKBGETKEYBOARD */
return Qlambda;