aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1996-07-16 06:10:35 +0000
committerKarl Heuer1996-07-16 06:10:35 +0000
commit8805890a4131c88e6171962e7e73b634b7e5527e (patch)
tree097688ea2edaba277680b28d3473d2209c4f5006 /src
parentac78b144414c85b78cca8da3368a81f95656c746 (diff)
downloademacs-8805890a4131c88e6171962e7e73b634b7e5527e.tar.gz
emacs-8805890a4131c88e6171962e7e73b634b7e5527e.zip
(SET_SAVED_MENU_EVENT): New macro.
(SET_SAVED_BUTTON_EVENT, SET_SAVED_KEY_EVENT): New macros. (XTread_socket): Use them.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 2a8b07ec95a..12850b0d1df 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -3211,6 +3211,22 @@ struct x_display_info *XTread_socket_fake_io_error;
3211 This variable is used for cycling thru the displays. */ 3211 This variable is used for cycling thru the displays. */
3212static struct x_display_info *next_noop_dpyinfo; 3212static struct x_display_info *next_noop_dpyinfo;
3213 3213
3214#define SET_SAVED_MENU_EVENT(size) { \
3215 if (f->output_data.x->saved_menu_event == 0) \
3216 f->output_data.x->saved_menu_event = (XEvent*)xmalloc (sizeof (XEvent)); \
3217 bcopy (&event, f->output_data.x->saved_menu_event, size); \
3218 if (numchars >= 1) \
3219 { \
3220 bufp->kind = menu_bar_activate_event; \
3221 XSETFRAME (bufp->frame_or_window, f); \
3222 bufp++; \
3223 count++; \
3224 numchars--; \
3225 } \
3226 }
3227#define SET_SAVED_BUTTON_EVENT SET_SAVED_MENU_EVENT (sizeof (XButtonEvent))
3228#define SET_SAVED_KEY_EVENT SET_SAVED_MENU_EVENT (sizeof (XKeyEvent))
3229
3214/* Read events coming from the X server. 3230/* Read events coming from the X server.
3215 This routine is called by the SIGIO handler. 3231 This routine is called by the SIGIO handler.
3216 We return as soon as there are no more events to be read. 3232 We return as soon as there are no more events to be read.
@@ -3226,8 +3242,8 @@ static struct x_display_info *next_noop_dpyinfo;
3226int 3242int
3227XTread_socket (sd, bufp, numchars, waitp, expected) 3243XTread_socket (sd, bufp, numchars, waitp, expected)
3228 register int sd; 3244 register int sd;
3229 register struct input_event *bufp; 3245 /* register */ struct input_event *bufp;
3230 register int numchars; 3246 /* register */ int numchars;
3231 int waitp; 3247 int waitp;
3232 int expected; 3248 int expected;
3233{ 3249{
@@ -3621,7 +3637,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
3621 f->output_data.x->menubar_widget 3637 f->output_data.x->menubar_widget
3622 )) 3638 ))
3623 { 3639 {
3624 XtDispatchEvent (&event); 3640 SET_SAVED_KEY_EVENT;
3625 break; 3641 break;
3626 } 3642 }
3627#endif /* USE_X_TOOLKIT */ 3643#endif /* USE_X_TOOLKIT */
@@ -4030,19 +4046,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected)
4030 && event.xbutton.y < f->output_data.x->menubar_height 4046 && event.xbutton.y < f->output_data.x->menubar_height
4031 && event.xbutton.same_screen) 4047 && event.xbutton.same_screen)
4032 { 4048 {
4033 if (f->output_data.x->saved_button_event == 0) 4049 SET_SAVED_BUTTON_EVENT;
4034 f->output_data.x->saved_button_event
4035 = (XButtonEvent *) xmalloc (sizeof (XButtonEvent));
4036 bcopy (&event, f->output_data.x->saved_button_event,
4037 sizeof (XButtonEvent));
4038 if (numchars >= 1)
4039 {
4040 bufp->kind = menu_bar_activate_event;
4041 XSETFRAME (bufp->frame_or_window, f);
4042 bufp++;
4043 count++;
4044 numchars--;
4045 }
4046 } 4050 }
4047 else 4051 else
4048 goto OTHER; 4052 goto OTHER;