diff options
author | Paul Eggert <[email protected]> | 2012-09-23 01:44:20 -0700 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2012-09-23 01:44:20 -0700 |
commit | 4d7e6e51dd4acecff466a28d958c50f34fc130b8 (patch) | |
tree | 5e340d48fb69f9a40a4304cc94db2006caefe51f /src/xfns.c | |
parent | 8f4635e97e1587c4026ec83fc1bd9f8954775915 (diff) |
Simplify and avoid signal-handling races.
* nt/inc/ms-w32.h (emacs_raise): New macro.
* src/alloc.c (die):
* src/sysdep.c (emacs_abort) [HAVE_NTGUI]:
Avoid recursive loop if there's a fatal error in the function itself.
* src/atimer.c (pending_atimers):
* src/blockinput.h: Don't include "atimer.h"; no longer needed.
(interrupt_input_pending): Remove. All uses removed.
pending_signals now counts both atimers and ordinary interrupts.
This is less racy than having three separate pending-signal flags.
(block_input, unblock_input, totally_unblock_input, unblock_input_to)
(input_blocked_p):
Rename from their upper-case counterparts BLOCK_INPUT,
UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
INPUT_BLOCKED_P, and turn into functions. All uses changed.
This makes it easier to access volatile variables more accurately.
(BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
(input_blocked_p): Prefer this to 'interrupt_input_blocked', as
that's more reliable if the code is buggy and sets
interrupt_input_blocked to a negative value. All uses changed.
* src/atimer.c (deliver_alarm_signal):
Remove. No need to deliver this to the parent; any thread can
handle this signal now. All uses replaced by underlying handler.
* src/atimer.c (turn_on_atimers):
* src/dispnew.c (handle_window_change_signal):
* src/emacs.c (handle_danger_signal):
* src/keyboard.c (kbd_buffer_get_event):
Don't reestablish signal handler; not needed with sigaction.
* src/blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
(UNBLOCK_INPUT_TO):
Rework to avoid unnecessary accesses to volatile variables.
(UNBLOCK_INPUT_TO): Now a function.
(totally_unblock_input, unblock_input): New decls.
* src/data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
(init_data): Remove. Necessary stuff now done in init_signal.
* src/emacs.c, src/xdisp.c: Include "atimer.h", since we invoke atimer functions.
* src/emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
(fatal_error_code): Remove; no longer needed.
(terminate_due_to_signal): Rename from fatal_error_backtrace, since
it doesn't always backtrace. All uses changed. No need to reset
signal to default, since sigaction and/or die does that for us now.
Use emacs_raise (FOO), not kill (getpid (), FOO).
(main): Check more-accurately whether we're dumping.
Move fatal-error setup to sysdep.c
* src/floatfns.c: Do not include "syssignal.h"; no longer needed.
* src/gtkutil.c (xg_get_file_name, xg_get_font):
Remove no-longer-needed signal-mask manipulation.
* src/keyboard.c, src/process.c (POLL_FOR_INPUT):
Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
* src/keyboard.c (read_avail_input): Remove.
All uses replaced by gobble_input.
(Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
(kbd_buffer_store_event_hold, gobble_input):
(record_asynch_buffer_change) [USABLE_SIGIO]:
(store_user_signal_events):
No need to mess with signal mask.
(gobble_input): If blocking input and there are terminals, simply
set pending_signals to 1 and return. All hooks changed to not
worry about whether input is blocked.
(process_pending_signals): Clear pending_signals before processing
them, in case a signal comes in while we're processing.
By convention callers now test pending_signals before calling us.
(UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
New functions, to support changes to blockinput.h.
(handle_input_available_signal): Now extern.
(reinvoke_input_signal): Remove. All uses replaced by
handle_async_input.
(quit_count): Now volatile, since a signal handler uses it.
(handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg. All
callers changed. Block SIGINT only if not already blocked.
Clear sigmask reliably, even if Fsignal returns, which it can.
Omit unnecessary accesses to volatile var.
(quit_throw_to_read_char): No need to restore sigmask.
* src/keyboard.c (gobble_input, handle_user_signal):
* src/process.c (wait_reading_process_output):
Call signal-handling code rather than killing ourselves.
* src/lisp.h: Include <float.h>, for...
(IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
(pending_signals): Now volatile.
(syms_of_data): Now const if IEEE floating point.
(handle_input_available_signal) [USABLE_SIGIO]:
(terminate_due_to_signal, record_child_status_change): New decls.
* src/process.c (create_process): Avoid disaster if memory is exhausted
while we're processing a vfork, by tightening the critical section
around the vfork.
(send_process_frame, process_sent_to, handle_pipe_signal)
(deliver_pipe_signal): Remove. No longer needed, as Emacs now
ignores SIGPIPE.
(send_process): No need for setjmp/longjmp any more, since the
SIGPIPE stuff is now gone. Instead, report an error if errno
is EPIPE.
(record_child_status_change): Now extern. PID and W are now args.
Return void, not bool. All callers changed.
* src/sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
Remove. All uses removed. This bug should be fixed now in a
different way.
(wait_for_termination_1): Use waitpid rather than sigsuspend,
and record the child status change directly. This avoids the
need to futz with the signal mask.
(process_fatal_action): Move here from emacs.c.
(emacs_sigaction_flags): New function, containing
much of what used to be in emacs_sigaction_init.
(emacs_sigaction_init): Use it. Block nonfatal system signals that are
caught by emacs, to make races less likely.
(deliver_process_signal): Rename from handle_on_main_thread.
All uses changed.
(BACKTRACE_LIMIT_MAX): Now at top level.
(thread_backtrace_buffer, threadback_backtrace_pointers):
New static vars.
(deliver_thread_signal, deliver_fatal_thread_signal):
New functions, for more-accurate delivery of thread-specific signals.
(handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
(deliver_arith_signal): Handle in this thread, not
in the main thread, since it's triggered by this thread.
(maybe_fatal_sig): New function.
(init_signals): New arg DUMPING so that we can be more accurate
about whether we're dumping. Caller changed.
Treat thread-specific signals differently from process-general signals.
Block all signals while handling fatal error; that's safer.
xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
on IEEE hosts.
When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
Ignore SIGPIPE unless batch.
(emacs_backtrace): Output backtrace for the appropriate thread,
which is not necessarily the main thread.
* src/syssignal.h: Include <stdbool.h>.
(emacs_raise): New macro.
* src/xterm.c (x_connection_signal): Remove; no longer needed
now that we use sigaction.
(x_connection_closed): No need to mess with sigmask now.
(x_initialize): No need to reset SIGPIPE handler here, since
init_signals does this for us now.
Fixes: debbugs:12471
Diffstat (limited to 'src/xfns.c')
-rw-r--r-- | src/xfns.c | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/src/xfns.c b/src/xfns.c index 8304a3df04..192ccb71a0 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -425,7 +425,7 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr) unsigned char *tmp_data = NULL; Atom target_type = XA_CARDINAL; - BLOCK_INPUT; + block_input (); x_catch_errors (dpy); @@ -543,7 +543,7 @@ x_real_positions (FRAME_PTR f, int *xptr, int *yptr) x_uncatch_errors (); - UNBLOCK_INPUT; + unblock_input (); if (had_errors) return; @@ -587,7 +587,7 @@ x_defined_color (struct frame *f, const char *color_name, 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 @@ -595,7 +595,7 @@ x_defined_color (struct frame *f, const char *color_name, 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; } @@ -679,7 +679,7 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file) GdkPixbuf *pixbuf; GError *err = NULL; char *filename = SSDATA (found); - BLOCK_INPUT; + block_input (); pixbuf = gdk_pixbuf_new_from_file (filename, &err); @@ -694,7 +694,7 @@ xg_set_icon (FRAME_PTR f, Lisp_Object file) else g_error_free (err); - UNBLOCK_INPUT; + unblock_input (); } return result; @@ -737,7 +737,7 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { Display *dpy = FRAME_X_DISPLAY (f); - BLOCK_INPUT; + block_input (); XSetForeground (dpy, x->normal_gc, fg); XSetBackground (dpy, x->reverse_gc, fg); @@ -748,7 +748,7 @@ x_set_foreground_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) XSetBackground (dpy, x->cursor_gc, x->cursor_pixel); } - UNBLOCK_INPUT; + unblock_input (); update_face_from_frame_parameter (f, Qforeground_color, arg); @@ -773,7 +773,7 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) { 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); @@ -797,7 +797,7 @@ x_set_background_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) } #endif /* USE_TOOLKIT_SCROLL_BARS */ - UNBLOCK_INPUT; + unblock_input (); update_face_from_frame_parameter (f, Qbackground_color, arg); if (FRAME_VISIBLE_P (f)) @@ -854,7 +854,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 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); @@ -974,7 +974,7 @@ x_set_mouse_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) x->horizontal_drag_cursor = horizontal_drag_cursor; XFlush (dpy); - UNBLOCK_INPUT; + unblock_input (); update_face_from_frame_parameter (f, Qmouse_color, arg); } @@ -1031,10 +1031,10 @@ x_set_cursor_color (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 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)) { @@ -1058,9 +1058,9 @@ x_set_border_pixel (struct frame *f, int pix) 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); @@ -1112,7 +1112,7 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) 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) @@ -1123,12 +1123,12 @@ x_set_icon_type (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (result) { - UNBLOCK_INPUT; + unblock_input (); error ("No icon window available"); } XFlush (FRAME_X_DISPLAY (f)); - UNBLOCK_INPUT; + unblock_input (); } static void @@ -1149,7 +1149,7 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (f->output_data.x->icon_bitmap != 0) return; - BLOCK_INPUT; + block_input (); result = x_text_icon (f, SSDATA ((!NILP (f->icon_name) @@ -1160,12 +1160,12 @@ x_set_icon_name (struct frame *f, Lisp_Object arg, Lisp_Object oldval) if (result) { - UNBLOCK_INPUT; + unblock_input (); error ("No icon window available"); } XFlush (FRAME_X_DISPLAY (f)); - UNBLOCK_INPUT; + unblock_input (); } @@ -1228,10 +1228,10 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) { 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) @@ -1239,10 +1239,10 @@ x_set_menu_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) 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)) @@ -1338,10 +1338,10 @@ x_set_tool_bar_lines (struct frame *f, Lisp_Object value, Lisp_Object oldval) /* 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)) @@ -1494,7 +1494,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name) { if (FRAME_X_WINDOW (f)) { - BLOCK_INPUT; + block_input (); { XTextProperty text, icon; ptrdiff_t bytes; @@ -1586,7 +1586,7 @@ x_set_name_internal (FRAME_PTR f, Lisp_Object name) if (do_free_text_value) xfree (text.value); } - UNBLOCK_INPUT; + unblock_input (); } } @@ -1779,7 +1779,7 @@ hack_wm_protocols (FRAME_PTR f, Widget widget) int need_focus = 1; int need_save = 1; - BLOCK_INPUT; + block_input (); { Atom type; unsigned char *catoms; @@ -1827,7 +1827,7 @@ hack_wm_protocols (FRAME_PTR f, Widget widget) XA_ATOM, 32, PropModeAppend, (unsigned char *) props, count); } - UNBLOCK_INPUT; + unblock_input (); } #endif @@ -2350,7 +2350,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) 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 @@ -2572,7 +2572,7 @@ x_window (struct frame *f, long window_prompting, int minibuffer_only) 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. */ @@ -2591,7 +2591,7 @@ x_window (FRAME_PTR f) FRAME_XIC (f) = NULL; if (use_xim) { - BLOCK_INPUT; + block_input (); create_frame_xic (f); if (FRAME_XIC (f)) { @@ -2613,7 +2613,7 @@ x_window (FRAME_PTR f) attribute_mask, &attributes); } } - UNBLOCK_INPUT; + unblock_input (); } #endif } @@ -2638,7 +2638,7 @@ x_window (struct frame *f) 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, @@ -2715,7 +2715,7 @@ x_window (struct frame *f) 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"); @@ -2768,7 +2768,7 @@ x_icon (struct frame *f, Lisp_Object parms) 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)); @@ -2787,7 +2787,7 @@ x_icon (struct frame *f, Lisp_Object parms) ? f->icon_name : f->name))); - UNBLOCK_INPUT; + unblock_input (); } /* Make the GCs needed for this window, setting the @@ -2799,7 +2799,7 @@ x_make_gc (struct frame *f) { XGCValues gc_values; - BLOCK_INPUT; + block_input (); /* Create the GCs of this frame. Note that many default values are used. */ @@ -2847,7 +2847,7 @@ x_make_gc (struct frame *f) FRAME_BACKGROUND_PIXEL (f), DefaultDepth (FRAME_X_DISPLAY (f), FRAME_X_SCREEN_NUMBER (f)))); - UNBLOCK_INPUT; + unblock_input (); } @@ -2858,7 +2858,7 @@ x_free_gcs (struct frame *f) { Display *dpy = FRAME_X_DISPLAY (f); - BLOCK_INPUT; + block_input (); if (f->output_data.x->normal_gc) { @@ -2884,7 +2884,7 @@ x_free_gcs (struct frame *f) f->output_data.x->border_tile = 0; } - UNBLOCK_INPUT; + unblock_input (); } @@ -3007,10 +3007,10 @@ If FRAME is nil, use the selected frame. */) 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; } @@ -3405,9 +3405,9 @@ This function is an internal primitive--use `make-frame' instead. */) /* 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 @@ -3431,7 +3431,7 @@ This function is an internal primitive--use `make-frame' instead. */) } } - BLOCK_INPUT; + block_input (); /* Set machine name and pid for the purpose of window managers. */ set_machine_and_pid_properties (f); @@ -3447,7 +3447,7 @@ This function is an internal primitive--use `make-frame' instead. */) (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. */ @@ -3506,7 +3506,7 @@ FRAME nil means use the selected frame. */) 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)) @@ -3524,7 +3524,7 @@ FRAME nil means use the selected frame. */) } x_uncatch_errors (); - UNBLOCK_INPUT; + unblock_input (); return Qnil; } @@ -4152,9 +4152,9 @@ If TERMINAL is omitted or nil, that stands for the selected frame's display. */ void x_sync (FRAME_PTR f) { - BLOCK_INPUT; + block_input (); XSync (FRAME_X_DISPLAY (f), False); - UNBLOCK_INPUT; + unblock_input (); } @@ -4229,7 +4229,7 @@ FRAME. Default is to change on the edit X window. */) nelements = SBYTES (value); } - BLOCK_INPUT; + block_input (); prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SSDATA (prop), False); if (! NILP (type)) { @@ -4248,7 +4248,7 @@ FRAME. Default is to change on the edit X window. */) /* Make sure the property is set when we return. */ XFlush (FRAME_X_DISPLAY (f)); - UNBLOCK_INPUT; + unblock_input (); return value; } @@ -4264,13 +4264,13 @@ FRAME nil or omitted means use the selected frame. Value is PROP. */) 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; } @@ -4318,7 +4318,7 @@ no value of TYPE (always string in the MS Windows case). */) target_window = FRAME_X_DISPLAY_INFO (f)->root_window; } - BLOCK_INPUT; + block_input (); if (STRINGP (type)) { if (strcmp ("AnyPropertyType", SSDATA (type)) == 0) @@ -4384,7 +4384,7 @@ no value of TYPE (always string in the MS Windows case). */) if (tmp_data) XFree (tmp_data); } - UNBLOCK_INPUT; + unblock_input (); UNGCPRO; return prop_value; } @@ -4415,7 +4415,7 @@ show_hourglass (struct atimer *timer) { Lisp_Object rest, frame; - BLOCK_INPUT; + block_input (); FOR_EACH_FRAME (rest, frame) { @@ -4459,7 +4459,7 @@ show_hourglass (struct atimer *timer) } hourglass_shown_p = 1; - UNBLOCK_INPUT; + unblock_input (); } } @@ -4474,7 +4474,7 @@ hide_hourglass (void) { Lisp_Object rest, frame; - BLOCK_INPUT; + block_input (); FOR_EACH_FRAME (rest, frame) { struct frame *f = XFRAME (frame); @@ -4493,7 +4493,7 @@ hide_hourglass (void) } hourglass_shown_p = 0; - UNBLOCK_INPUT; + unblock_input (); } } @@ -4743,7 +4743,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, 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; @@ -4770,7 +4770,7 @@ x_create_tip_frame (struct x_display_info *dpyinfo, 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); @@ -4884,10 +4884,10 @@ compute_tip_xy (struct frame *f, Lisp_Object parms, Lisp_Object dx, Lisp_Object 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)) @@ -4990,7 +4990,7 @@ Text larger than the specified size is clipped. */) /* 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); @@ -4998,7 +4998,7 @@ Text larger than the specified size is clipped. */) /* This is used in Fx_hide_tip. */ XSETFRAME (tip_frame, f); } - UNBLOCK_INPUT; + unblock_input (); if (ok) goto start_timer; } #endif /* USE_GTK */ @@ -5026,12 +5026,12 @@ Text larger than the specified size is clipped. */) 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; } } @@ -5185,11 +5185,11 @@ Text larger than the specified size is clipped. */) 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; @@ -5261,9 +5261,9 @@ Value is t if tooltip was open, nil otherwise. */) if (!DoesSaveUnders (FRAME_X_DISPLAY_INFO (f)->screen) && w != NULL) { - BLOCK_INPUT; + block_input (); xlwmenu_redisplay (w); - UNBLOCK_INPUT; + unblock_input (); } } #endif /* USE_LUCID */ @@ -5327,11 +5327,11 @@ clean_up_file_dialog (Lisp_Object arg) 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; } @@ -5372,7 +5372,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) /* 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. */ @@ -5486,7 +5486,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) else file = Qnil; - UNBLOCK_INPUT; + unblock_input (); UNGCPRO; /* Make "Cancel" equivalent to C-g. */ @@ -5543,7 +5543,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) specbind (Qinhibit_redisplay, Qt); record_unwind_protect (clean_up_dialog, Qnil); - BLOCK_INPUT; + block_input (); if (STRINGP (default_filename)) cdef_file = SSDATA (default_filename); @@ -5560,7 +5560,7 @@ Otherwise, if ONLY-DIR-P is non-nil, the user can only select directories. */) xfree (fn); } - UNBLOCK_INPUT; + unblock_input (); UNGCPRO; /* Make "Cancel" equivalent to C-g. */ @@ -5600,7 +5600,7 @@ nil, it defaults to the selected frame. */) specbind (Qinhibit_redisplay, Qt); record_unwind_protect (clean_up_dialog, Qnil); - BLOCK_INPUT; + block_input (); GCPRO2 (font_param, font); @@ -5618,7 +5618,7 @@ nil, it defaults to the selected frame. */) font = xg_get_font (f, default_name); xfree (default_name); - UNBLOCK_INPUT; + unblock_input (); if (NILP (font)) Fsignal (Qquit, Qnil); @@ -5655,14 +5655,14 @@ present and mapped to the usual X keysyms. */) 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; } @@ -5671,7 +5671,7 @@ present and mapped to the usual X keysyms. */) minor = XkbMinorVersion; if (!XkbQueryExtension (dpy, &op, &event, &error_code, &major, &minor)) { - UNBLOCK_INPUT; + unblock_input (); return Qlambda; } @@ -5724,7 +5724,7 @@ present and mapped to the usual X keysyms. */) && XKeysymToKeycode (dpy, XK_BackSpace) == backspace_keycode) have_keys = Qt; } - UNBLOCK_INPUT; + unblock_input (); return have_keys; #else /* not HAVE_XKBGETKEYBOARD */ return Qlambda; |