/* Used in x_flush. */
-static int x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
+static bool x_alloc_nearest_color_1 (Display *, Colormap, XColor *);
static void x_set_window_size_1 (struct frame *, int, int, int);
static void x_raise_frame (struct frame *);
static void x_lower_frame (struct frame *);
if (!NILP (Vinhibit_redisplay))
return;
- BLOCK_INPUT;
+ block_input ();
if (f == NULL)
{
Lisp_Object rest, frame;
}
else if (FRAME_X_P (f))
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
updated_window = w;
set_output_cursor (&w->cursor);
- BLOCK_INPUT;
+ block_input ();
if (f == hlinfo->mouse_face_mouse_frame)
{
hlinfo->mouse_face_window = Qnil;
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
if (!w->pseudo_window_p)
{
- BLOCK_INPUT;
+ block_input ();
if (cursor_on_p)
display_and_set_cursor (w, 1, output_cursor.hpos,
if (draw_window_fringes (w, 1))
x_draw_vertical_border (w);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* If a row with mouse-face was overwritten, arrange for
MOUSE_HL_INFO (f)->mouse_face_defer = 0;
#ifndef XFlush
- BLOCK_INPUT;
+ block_input ();
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
#endif
}
if (hlinfo->mouse_face_deferred_gc
|| f == hlinfo->mouse_face_mouse_frame)
{
- BLOCK_INPUT;
+ block_input ();
if (hlinfo->mouse_face_mouse_frame)
note_mouse_highlight (hlinfo->mouse_face_mouse_frame,
hlinfo->mouse_face_mouse_x,
hlinfo->mouse_face_mouse_y);
hlinfo->mouse_face_deferred_gc = 0;
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
}
{
int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y));
- BLOCK_INPUT;
+ block_input ();
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
0, y, width, height, False);
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
FRAME_PIXEL_WIDTH (f) - width,
y, width, height, False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
static void x_set_cursor_gc (struct glyph_string *);
static void x_set_mode_line_face_gc (struct glyph_string *);
static void x_set_mouse_face_gc (struct glyph_string *);
-static int x_alloc_lighter_color (struct frame *, Display *, Colormap,
- unsigned long *, double, int);
+static bool x_alloc_lighter_color (struct frame *, Display *, Colormap,
+ unsigned long *, double, int);
static void x_setup_relief_color (struct frame *, struct relief *,
double, int, unsigned long);
static void x_setup_relief_colors (struct glyph_string *);
If this produces the same color as PIXEL, try a color where all RGB
values have DELTA added. Return the allocated color in *PIXEL.
DISPLAY is the X display, CMAP is the colormap to operate on.
- Value is non-zero if successful. */
+ Value is true if successful. */
-int
+bool
x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap,
unsigned long *pixel, double factor, int delta)
{
/* Allocate the color COLOR->pixel on DISPLAY, colormap CMAP. If an
exact match can't be allocated, try the nearest color available.
- Value is non-zero if successful. Set *COLOR to the color
+ Value is true if successful. Set *COLOR to the color
allocated. */
-static int
+static bool
x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
{
- int rc;
+ bool rc;
- rc = XAllocColor (dpy, cmap, color);
+ rc = XAllocColor (dpy, cmap, color) != 0;
if (rc == 0)
{
/* If we got to this point, the colormap is full, so we're going
color->red = cells[nearest].red;
color->green = cells[nearest].green;
color->blue = cells[nearest].blue;
- rc = XAllocColor (dpy, cmap, color);
+ rc = XAllocColor (dpy, cmap, color) != 0;
}
else
{
/* Allocate the color COLOR->pixel on frame F, colormap CMAP. If an
exact match can't be allocated, try the nearest color available.
- Value is non-zero if successful. Set *COLOR to the color
+ Value is true if successful. Set *COLOR to the color
allocated. */
-int
+bool
x_alloc_nearest_color (struct frame *f, Colormap cmap, XColor *color)
{
gamma_correct (f, color);
XColor color;
color.pixel = pixel;
- BLOCK_INPUT;
+ block_input ();
x_query_color (f, &color);
XAllocColor (FRAME_X_DISPLAY (f), FRAME_X_COLORMAP (f), &color);
- UNBLOCK_INPUT;
+ unblock_input ();
#ifdef DEBUG_X_COLORS
register_color (pixel);
#endif
DISPLAY is the X display, CMAP is the colormap to operate on.
Value is non-zero if successful. */
-static int
+static bool
x_alloc_lighter_color (struct frame *f, Display *display, Colormap cmap, long unsigned int *pixel, double factor, int delta)
{
XColor color, new;
long bright;
- int success_p;
+ bool success_p;
/* Get RGB color values. */
color.pixel = *pixel;
/* We don't set the output cursor here because there will always
follow an explicit cursor_to. */
- BLOCK_INPUT;
+ block_input ();
XClearWindow (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f));
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
static void
XTflash (struct frame *f)
{
- BLOCK_INPUT;
+ block_input ();
{
#ifdef USE_GTK
}
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
static void
XTtoggle_invisible_pointer (FRAME_PTR f, int invisible)
{
- BLOCK_INPUT;
+ block_input ();
if (invisible)
{
if (FRAME_X_DISPLAY_INFO (f)->invisible_cursor != 0)
XDefineCursor (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->current_cursor);
f->pointer_invisible = invisible;
- UNBLOCK_INPUT;
+ unblock_input ();
}
XTflash (f);
else
{
- BLOCK_INPUT;
+ block_input ();
XBell (FRAME_X_DISPLAY (f), 0);
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
}
height = run->height;
}
- BLOCK_INPUT;
+ block_input ();
/* Cursor off. Will be switched on again in x_update_window_end. */
updated_window = w;
width, height,
x, to_y);
- UNBLOCK_INPUT;
+ unblock_input ();
}
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
client", so we can always change it to whatever we want. */
- BLOCK_INPUT;
+ block_input ();
/* I recently started to get errors in this XSetWindowBorder, depending on
the window-manager in use, tho something more is at play since I've been
using that same window-manager binary for ever. Let's not crash just
XSetWindowBorder (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_pixel);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
x_update_cursor (f, 1);
x_set_frame_alpha (f);
}
the ICCCM (section 4.1.6) says that the window's border pixmap
and border pixel are window attributes which are "private to the
client", so we can always change it to whatever we want. */
- BLOCK_INPUT;
+ block_input ();
/* Same as above for XSetWindowBorder (bug#9310). */
x_catch_errors (FRAME_X_DISPLAY (f));
XSetWindowBorderPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
f->output_data.x->border_tile);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
x_update_cursor (f, 1);
x_set_frame_alpha (f);
}
{
char *value;
- BLOCK_INPUT;
+ block_input ();
value = XKeysymToString (keysym);
- UNBLOCK_INPUT;
+ unblock_input ();
return value;
}
{
FRAME_PTR f1;
- BLOCK_INPUT;
+ block_input ();
if (! NILP (last_mouse_scroll_bar) && insist == 0)
x_scroll_bar_report_motion (fp, bar_window, part, x, y, timestamp);
}
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
struct frame *f = XFRAME (w->frame);
ptrdiff_t i;
- BLOCK_INPUT;
+ block_input ();
/* Construct a ClientMessage event to send to the frame. */
ev->type = ClientMessage;
be sent to the client that created the window, and if that
window no longer exists, no event will be sent. */
XSendEvent (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), False, 0, &event);
- UNBLOCK_INPUT;
+ unblock_input ();
}
int slider_size;
/* Get the slider size. */
- BLOCK_INPUT;
+ block_input ();
XtVaGetValues (widget, XmNsliderSize, &slider_size, NULL);
- UNBLOCK_INPUT;
+ unblock_input ();
whole = XM_SB_MAX - slider_size;
portion = min (cs->value, whole);
int part;
/* Get the size of the thumb, a value between 0 and 1. */
- BLOCK_INPUT;
+ block_input ();
XtVaGetValues (widget, XtNshown, &shown, XtNheight, &height, NULL);
- UNBLOCK_INPUT;
+ unblock_input ();
whole = 10000000;
portion = shown < 1 ? top * whole : 0;
int part;
/* Get the height of the scroll bar. */
- BLOCK_INPUT;
+ block_input ();
XtVaGetValues (widget, XtNheight, &height, NULL);
- UNBLOCK_INPUT;
+ unblock_input ();
if (eabs (position) >= height)
part = (position < 0) ? scroll_bar_above_handle : scroll_bar_below_handle;
{
const char *scroll_bar_name = SCROLL_BAR_NAME;
- BLOCK_INPUT;
+ block_input ();
xg_create_scroll_bar (f, bar, G_CALLBACK (xg_scroll_callback),
G_CALLBACK (xg_end_scroll_callback),
scroll_bar_name);
- UNBLOCK_INPUT;
+ unblock_input ();
}
#else /* not USE_GTK */
const char *scroll_bar_name = SCROLL_BAR_NAME;
unsigned long pixel;
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_MOTIF
/* Set resources. Create the widget. */
xwindow = XtWindow (widget);
bar->x_window = xwindow;
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* not USE_GTK */
Widget widget = SCROLL_BAR_X_WIDGET (FRAME_X_DISPLAY (f), bar);
float top, shown;
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_MOTIF
}
#endif /* !USE_MOTIF */
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* not USE_GTK */
= ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER);
Lisp_Object barobj;
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_TOOLKIT_SCROLL_BARS
x_create_toolkit_scroll_bar (f, bar);
XMapRaised (FRAME_X_DISPLAY (f), bar->x_window);
#endif /* not USE_TOOLKIT_SCROLL_BARS */
- UNBLOCK_INPUT;
+ unblock_input ();
return bar;
}
&& end == bar->end)
return;
- BLOCK_INPUT;
+ block_input ();
{
int inside_width = VERTICAL_SCROLL_BAR_INSIDE_WIDTH (f, bar->width);
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* !USE_TOOLKIT_SCROLL_BARS */
x_scroll_bar_remove (struct scroll_bar *bar)
{
struct frame *f = XFRAME (WINDOW_FRAME (XWINDOW (bar->window)));
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_TOOLKIT_SCROLL_BARS
#ifdef USE_GTK
/* Dissociate this scroll bar from its window. */
wset_vertical_scroll_bar (XWINDOW (bar->window), Qnil);
- UNBLOCK_INPUT;
+ unblock_input ();
}
{
if (width > 0 && height > 0)
{
- BLOCK_INPUT;
+ block_input ();
#ifdef USE_TOOLKIT_SCROLL_BARS
if (fringe_extended_p)
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
#endif
x_clear_area (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
left, top, width, height, False);
- UNBLOCK_INPUT;
+ unblock_input ();
}
bar = x_scroll_bar_create (w, top, sb_left, sb_width, height);
bar = XSCROLL_BAR (w->vertical_scroll_bar);
- BLOCK_INPUT;
+ block_input ();
if (sb_left != bar->left)
mask |= CWX;
bar->width = sb_width;
bar->height = height;
- UNBLOCK_INPUT;
+ unblock_input ();
}
#ifdef USE_TOOLKIT_SCROLL_BARS
GC gc = f->output_data.x->normal_gc;
int width_trim = VERTICAL_SCROLL_BAR_WIDTH_TRIM;
- BLOCK_INPUT;
+ block_input ();
x_scroll_bar_set_handle (bar, bar->start, bar->end, 1);
XSetForeground (FRAME_X_DISPLAY (f), gc,
FRAME_FOREGROUND_PIXEL (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* not USE_TOOLKIT_SCROLL_BARS */
int dummy_coord;
unsigned int dummy_mask;
- BLOCK_INPUT;
+ block_input ();
/* Get the mouse's position relative to the scroll bar window, and
report that. */
*timestamp = last_mouse_movement_time;
- UNBLOCK_INPUT;
+ unblock_input ();
}
{
XEvent *xev = (XEvent *) gxev;
- BLOCK_INPUT;
+ block_input ();
if (current_count >= 0)
{
struct x_display_info *dpyinfo;
&& dpyinfo
&& x_filter_event (dpyinfo, xev))
{
- UNBLOCK_INPUT;
+ unblock_input ();
return GDK_FILTER_REMOVE;
}
#endif
else
current_finish = x_dispatch_event (xev, xev->xany.display);
- UNBLOCK_INPUT;
+ unblock_input ();
if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP)
return GDK_FILTER_REMOVE;
default:
OTHER:
#ifdef USE_X_TOOLKIT
- BLOCK_INPUT;
+ block_input ();
if (*finish != X_EVENT_DROP)
XtDispatchEvent (&event);
- UNBLOCK_INPUT;
+ unblock_input ();
#endif /* USE_X_TOOLKIT */
break;
}
/* Read events coming from the X server.
- This routine is called by the SIGIO handler only if SYNC_INPUT is
- not defined.
- We return as soon as there are no more events to be read.
+ Return as soon as there are no more events to be read.
- We return the number of characters stored into the buffer,
+ Return the number of characters stored into the buffer,
thus pretending to be `read' (except the characters we store
in the keyboard buffer can be multibyte, so are not necessarily
- C chars).
-
- EXPECTED is nonzero if the caller knows input is available. */
+ C chars). */
static int
-XTread_socket (struct terminal *terminal, int expected, struct input_event *hold_quit)
+XTread_socket (struct terminal *terminal, struct input_event *hold_quit)
{
int count = 0;
int event_found = 0;
- if (interrupt_input_blocked)
- {
- interrupt_input_pending = 1;
-#ifdef SYNC_INPUT
- pending_signals = 1;
-#endif
- return -1;
- }
-
- interrupt_input_pending = 0;
-#ifdef SYNC_INPUT
- pending_signals = pending_atimers;
-#endif
- BLOCK_INPUT;
+ block_input ();
/* So people can tell when we have read the available input. */
input_signal_count++;
-#ifndef SYNC_INPUT
- ++handling_signal;
-#endif
-
/* For debugging, this gives a way to fake an I/O error. */
if (terminal->display_info.x == XTread_socket_fake_io_error)
{
pending_autoraise_frame = 0;
}
-#ifndef SYNC_INPUT
- --handling_signal;
-#endif
- UNBLOCK_INPUT;
+ unblock_input ();
return count;
}
{
struct x_error_message_stack *tmp;
- BLOCK_INPUT;
+ block_input ();
/* The display may have been closed before this function is called.
Check if it is still open before calling XSync. */
tmp = x_error_message;
x_error_message = x_error_message->prev;
xfree (tmp);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* If any X protocol errors have arrived since the last call to
}
#endif /* ! 0 */
-\f
-/* Handle SIGPIPE, which can happen when the connection to a server
- simply goes away. SIGPIPE is handled by x_connection_signal.
- Don't need to do anything, because the write which caused the
- SIGPIPE will fail, causing Xlib to invoke the X IO error handler,
- which will do the appropriate cleanup for us. */
-
-static void
-x_connection_signal (int signalnum) /* If we don't have an argument, */
- /* some compilers complain in signal calls. */
-{
-#ifdef USG
- /* USG systems forget handlers when they are used;
- must reestablish each time */
- struct sigaction action;
- emacs_sigaction_init (&action, x_connection_signal);
- sigaction (signalnum, &action, 0);
-#endif /* USG */
-}
-
\f
/************************************************************************
Handling X errors
error_msg = alloca (strlen (error_message) + 1);
strcpy (error_msg, error_message);
- handling_signal = 0;
/* Inhibit redisplay while frames are being deleted. */
specbind (Qinhibit_redisplay, Qt);
/* NOTREACHED */
}
- /* Ordinary stack unwind doesn't deal with these. */
- {
- sigset_t unblocked;
- sigemptyset (&unblocked);
-#ifdef USABLE_SIGIO
- sigaddset (&unblocked, SIGIO);
-#endif
- sigaddset (&unblocked, SIGALRM);
- pthread_sigmask (SIG_UNBLOCK, &unblocked, 0);
- }
- TOTALLY_UNBLOCK_INPUT;
+ totally_unblock_input ();
unbind_to (idx, Qnil);
clear_waiting_for_input ();
if (FRAME_XIC (f)
&& (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea)))
{
- BLOCK_INPUT;
+ block_input ();
xic_set_xfontset (f, SSDATA (fontset_ascii (fontset)));
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif
struct x_display_info *dpyinfo = (struct x_display_info *) client_data;
Lisp_Object frame, tail;
- BLOCK_INPUT;
+ block_input ();
/* No need to call XDestroyIC.. */
FOR_EACH_FRAME (tail, frame)
/* No need to call XCloseIM. */
dpyinfo->xim = NULL;
XFree (dpyinfo->xim_styles);
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* HAVE_X11R6 */
{
Lisp_Object tail, frame;
- BLOCK_INPUT;
+ block_input ();
FOR_EACH_FRAME (tail, frame)
{
struct frame *f = XFRAME (frame);
}
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
}
x_calc_absolute_position (f);
- BLOCK_INPUT;
+ block_input ();
x_wm_set_size_hint (f, (long) 0, 0);
modified_left = f->left_pos;
&& FRAME_X_OUTPUT (f)->move_offset_top == 0))))
x_check_expected_move (f, modified_left, modified_top);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Return non-zero if _NET_SUPPORTING_WM_CHECK window exists and _NET_SUPPORTED
unsigned char *tmp_data = NULL;
Atom target_type = XA_WINDOW;
- BLOCK_INPUT;
+ block_input ();
x_catch_errors (dpy);
rc = XGetWindowProperty (dpy, target_window,
{
if (tmp_data) XFree (tmp_data);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return 0;
}
if (x_had_errors_p (dpy))
{
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return 0;
}
{
if (tmp_data) XFree (tmp_data);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return 0;
}
rc = dpyinfo->net_supported_atoms[i] == want_atom;
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return rc;
}
*sticky = 0;
*size_state = FULLSCREEN_NONE;
- BLOCK_INPUT;
+ block_input ();
x_catch_errors (dpy);
rc = XGetWindowProperty (dpy, window, dpyinfo->Xatom_net_wm_state,
0, max_len, False, target_type,
{
if (tmp_data) XFree (tmp_data);
x_uncatch_errors ();
- UNBLOCK_INPUT;
+ unblock_input ();
return ! f->iconified;
}
}
if (tmp_data) XFree (tmp_data);
- UNBLOCK_INPUT;
+ unblock_input ();
return ! is_hidden;
}
{
if (f->async_visible)
{
- BLOCK_INPUT;
+ block_input ();
x_check_fullscreen (f);
x_sync (f);
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
while (pending_event_wait.eventtype)
{
- interrupt_input_pending = 1;
- TOTALLY_UNBLOCK_INPUT;
+ pending_signals = 1;
+ totally_unblock_input ();
/* XTread_socket is called after unblock. */
- BLOCK_INPUT;
+ block_input ();
interrupt_input_blocked = level;
FD_ZERO (&fds);
void
x_set_window_size (struct frame *f, int change_gravity, int cols, int rows)
{
- BLOCK_INPUT;
+ block_input ();
if (NILP (tip_frame) || XFRAME (tip_frame) != f)
{
so don't try--just let the highlighting be done afresh with new size. */
cancel_mouse_face (f);
- UNBLOCK_INPUT;
+ unblock_input ();
}
\f
/* Mouse warping. */
if (pix_y < 0) pix_y = 0;
if (pix_y > FRAME_PIXEL_HEIGHT (f)) pix_y = FRAME_PIXEL_HEIGHT (f);
- BLOCK_INPUT;
+ block_input ();
XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f),
0, 0, 0, 0, pix_x, pix_y);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Move the mouse to position pixel PIX_X, PIX_Y relative to frame F. */
void
x_set_mouse_pixel_position (struct frame *f, int pix_x, int pix_y)
{
- BLOCK_INPUT;
+ block_input ();
XWarpPointer (FRAME_X_DISPLAY (f), None, FRAME_X_WINDOW (f),
0, 0, 0, 0, pix_x, pix_y);
- UNBLOCK_INPUT;
+ unblock_input ();
}
\f
/* Raise frame F. */
void
x_raise_frame (struct frame *f)
{
- BLOCK_INPUT;
+ block_input ();
if (f->async_visible)
XRaiseWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Lower frame F. */
{
if (f->async_visible)
{
- BLOCK_INPUT;
+ block_input ();
XLowerWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f));
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
}
}
retry:
- BLOCK_INPUT;
+ block_input ();
type = x_icon_type (f);
if (!NILP (type))
original_top = f->top_pos;
/* This must come after we set COUNT. */
- UNBLOCK_INPUT;
+ unblock_input ();
/* We unblock here so that arriving X events are processed. */
int x, y;
unsigned int width, height, border, depth;
- BLOCK_INPUT;
+ block_input ();
/* On some window managers (such as FVWM) moving an existing
window, even to the same place, causes the window manager
XMoveWindow (FRAME_X_DISPLAY (f), FRAME_OUTER_WINDOW (f),
original_left, original_top);
- UNBLOCK_INPUT;
+ unblock_input ();
}
XSETFRAME (frame, f);
if (FRAME_X_DISPLAY_INFO (f)->x_highlight_frame == f)
FRAME_X_DISPLAY_INFO (f)->x_highlight_frame = 0;
- BLOCK_INPUT;
+ block_input ();
/* Before unmapping the window, update the WM_SIZE_HINTS property to claim
that the current position of the window is user-specified, rather than
if (! XWithdrawWindow (FRAME_X_DISPLAY (f), window,
DefaultScreen (FRAME_X_DISPLAY (f))))
{
- UNBLOCK_INPUT_RESIGNAL;
+ unblock_input ();
error ("Can't notify window manager of window withdrawal");
}
}
x_sync (f);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Change window state from mapped to iconified. */
if (f->async_iconified)
return;
- BLOCK_INPUT;
+ block_input ();
FRAME_SAMPLE_VISIBILITY (f);
f->visible = 1;
f->async_iconified = 1;
f->async_visible = 0;
- UNBLOCK_INPUT;
+ unblock_input ();
return;
}
#endif
f->visible = 1;
f->async_iconified = 1;
f->async_visible = 0;
- UNBLOCK_INPUT;
+ unblock_input ();
return;
}
result = XIconifyWindow (FRAME_X_DISPLAY (f),
XtWindow (f->output_data.x->widget),
DefaultScreen (FRAME_X_DISPLAY (f)));
- UNBLOCK_INPUT;
+ unblock_input ();
if (!result)
error ("Can't notify window manager of iconification");
f->async_visible = 0;
- BLOCK_INPUT;
+ block_input ();
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
#else /* not USE_X_TOOLKIT */
/* Make sure the X server knows where the window should be positioned,
SubstructureRedirectMask | SubstructureNotifyMask,
&msg))
{
- UNBLOCK_INPUT_RESIGNAL;
+ unblock_input ();
error ("Can't notify window manager of iconification");
}
}
f->async_visible = 0;
XFlush (FRAME_X_DISPLAY (f));
- UNBLOCK_INPUT;
+ unblock_input ();
#endif /* not USE_X_TOOLKIT */
}
struct scroll_bar *b;
#endif
- BLOCK_INPUT;
+ block_input ();
/* If a display connection is dead, don't try sending more
commands to the X server. */
hlinfo->mouse_face_mouse_frame = 0;
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Set the normal size hints for the window manager, for frame F.
FLAGS is the flags word to use--or 0 meaning preserve the flags
that the window now has.
- If USER_POSITION is nonzero, we set the USPosition
+ If USER_POSITION, set the USPosition
flag (this is useful when FLAGS is 0).
- The GTK version is in gtkutils.c */
+ The GTK version is in gtkutils.c. */
#ifndef USE_GTK
void
-x_wm_set_size_hint (struct frame *f, long flags, int user_position)
+x_wm_set_size_hint (struct frame *f, long flags, bool user_position)
{
XSizeHints size_hints;
Window window = FRAME_OUTER_WINDOW (f);
Mouse_HLInfo *hlinfo;
ptrdiff_t lim;
- BLOCK_INPUT;
+ block_input ();
if (!x_initialized)
{
Call before gtk_init so Gtk+ event filters comes after our. */
gdk_window_add_filter (NULL, event_handler_gdk, NULL);
+ /* gtk_init does set_locale. Fix locale before and after. */
+ fixup_locale ();
gtk_init (&argc, &argv2);
+ fixup_locale ();
+
g_log_remove_handler ("GLib", id);
- /* gtk_init does set_locale. We must fix locale after calling it. */
- fixup_locale ();
xg_initialize ();
dpy = DEFAULT_GDK_DISPLAY ();
/* Detect failure. */
if (dpy == 0)
{
- UNBLOCK_INPUT;
+ unblock_input ();
return 0;
}
/* Temporarily hide the partially initialized terminal. */
terminal_list = terminal->next_terminal;
- UNBLOCK_INPUT;
+ unblock_input ();
kset_system_key_alist
(terminal->kboard,
call1 (Qvendor_specific_keysyms,
vendor ? build_string (vendor) : empty_unibyte_string));
- BLOCK_INPUT;
+ block_input ();
terminal->next_terminal = terminal_list;
terminal_list = terminal;
UNGCPRO;
x_session_initialize (dpyinfo);
#endif
- UNBLOCK_INPUT;
+ unblock_input ();
return dpyinfo;
}
static void
x_process_timeouts (struct atimer *timer)
{
- BLOCK_INPUT;
+ block_input ();
x_timeout_atimer_activated_flag = 0;
if (toolkit_scroll_bar_interaction || popup_activated ())
{
/* Reactivate the atimer for next time. */
x_activate_timeout_atimer ();
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Install an asynchronous timer that processes Xt timeout events
void
x_activate_timeout_atimer (void)
{
- BLOCK_INPUT;
+ block_input ();
if (!x_timeout_atimer_activated_flag)
{
EMACS_TIME interval = make_emacs_time (0, 100 * 1000 * 1000);
start_atimer (ATIMER_RELATIVE, interval, x_process_timeouts, 0);
x_timeout_atimer_activated_flag = 1;
}
- UNBLOCK_INPUT;
+ unblock_input ();
}
#endif /* USE_X_TOOLKIT */
if (!terminal->name)
return;
- BLOCK_INPUT;
+ block_input ();
#ifdef HAVE_X_I18N
/* We must close our connection to the XIM server before closing the
X display. */
/* Mark as dead. */
dpyinfo->display = NULL;
x_delete_display (dpyinfo);
- UNBLOCK_INPUT;
+ unblock_input ();
}
/* Create a struct terminal, initialize it with the X11 specific
void
x_initialize (void)
{
- struct sigaction action;
-
baud_rate = 19200;
x_noop_count = 0;
original error handler. */
XSetErrorHandler (x_error_handler);
XSetIOErrorHandler (x_io_error_quitter);
-
- emacs_sigaction_init (&action, x_connection_signal);
- sigaction (SIGPIPE, &action, 0);
}