5619 |
f->output_data.x->saved_menu_event \ |
f->output_data.x->saved_menu_event \ |
5620 |
= (XEvent *) xmalloc (sizeof (XEvent)); \ |
= (XEvent *) xmalloc (sizeof (XEvent)); \ |
5621 |
bcopy (&event, f->output_data.x->saved_menu_event, size); \ |
bcopy (&event, f->output_data.x->saved_menu_event, size); \ |
5622 |
inev.kind = MENU_BAR_ACTIVATE_EVENT; \ |
inev.ie.kind = MENU_BAR_ACTIVATE_EVENT; \ |
5623 |
XSETFRAME (inev.frame_or_window, f); \ |
XSETFRAME (inev.ie.frame_or_window, f); \ |
5624 |
} \ |
} \ |
5625 |
while (0) |
while (0) |
5626 |
|
|
5727 |
int *finish; |
int *finish; |
5728 |
struct input_event *hold_quit; |
struct input_event *hold_quit; |
5729 |
{ |
{ |
5730 |
struct input_event inev; |
union { |
5731 |
|
struct input_event ie; |
5732 |
|
struct selection_input_event sie; |
5733 |
|
} inev; |
5734 |
int count = 0; |
int count = 0; |
5735 |
int do_help = 0; |
int do_help = 0; |
5736 |
int nbytes = 0; |
int nbytes = 0; |
5740 |
|
|
5741 |
*finish = X_EVENT_NORMAL; |
*finish = X_EVENT_NORMAL; |
5742 |
|
|
5743 |
EVENT_INIT (inev); |
EVENT_INIT (inev.ie); |
5744 |
inev.kind = NO_EVENT; |
inev.ie.kind = NO_EVENT; |
5745 |
inev.arg = Qnil; |
inev.ie.arg = Qnil; |
5746 |
|
|
5747 |
switch (event.type) |
switch (event.type) |
5748 |
{ |
{ |
5840 |
if (!f) |
if (!f) |
5841 |
goto OTHER; /* May be a dialog that is to be removed */ |
goto OTHER; /* May be a dialog that is to be removed */ |
5842 |
|
|
5843 |
inev.kind = DELETE_WINDOW_EVENT; |
inev.ie.kind = DELETE_WINDOW_EVENT; |
5844 |
XSETFRAME (inev.frame_or_window, f); |
XSETFRAME (inev.ie.frame_or_window, f); |
5845 |
goto done; |
goto done; |
5846 |
} |
} |
5847 |
|
|
5904 |
if (event.xclient.message_type |
if (event.xclient.message_type |
5905 |
== dpyinfo->Xatom_Scrollbar) |
== dpyinfo->Xatom_Scrollbar) |
5906 |
{ |
{ |
5907 |
x_scroll_bar_to_input_event (&event, &inev); |
x_scroll_bar_to_input_event (&event, &inev.ie); |
5908 |
*finish = X_EVENT_GOTO_OUT; |
*finish = X_EVENT_GOTO_OUT; |
5909 |
goto done; |
goto done; |
5910 |
} |
} |
5915 |
if (!f) |
if (!f) |
5916 |
goto OTHER; |
goto OTHER; |
5917 |
|
|
5918 |
if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev)) |
if (x_handle_dnd_message (f, &event.xclient, dpyinfo, &inev.ie)) |
5919 |
*finish = X_EVENT_DROP; |
*finish = X_EVENT_DROP; |
5920 |
} |
} |
5921 |
break; |
break; |
5936 |
{ |
{ |
5937 |
XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; |
XSelectionClearEvent *eventp = (XSelectionClearEvent *) &event; |
5938 |
|
|
5939 |
inev.kind = SELECTION_CLEAR_EVENT; |
inev.ie.kind = SELECTION_CLEAR_EVENT; |
5940 |
SELECTION_EVENT_DISPLAY (&inev) = eventp->display; |
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; |
5941 |
SELECTION_EVENT_SELECTION (&inev) = eventp->selection; |
SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection; |
5942 |
SELECTION_EVENT_TIME (&inev) = eventp->time; |
SELECTION_EVENT_TIME (&inev.sie) = eventp->time; |
5943 |
inev.frame_or_window = Qnil; |
inev.ie.frame_or_window = Qnil; |
5944 |
} |
} |
5945 |
break; |
break; |
5946 |
|
|
5953 |
XSelectionRequestEvent *eventp |
XSelectionRequestEvent *eventp |
5954 |
= (XSelectionRequestEvent *) &event; |
= (XSelectionRequestEvent *) &event; |
5955 |
|
|
5956 |
inev.kind = SELECTION_REQUEST_EVENT; |
inev.ie.kind = SELECTION_REQUEST_EVENT; |
5957 |
SELECTION_EVENT_DISPLAY (&inev) = eventp->display; |
SELECTION_EVENT_DISPLAY (&inev.sie) = eventp->display; |
5958 |
SELECTION_EVENT_REQUESTOR (&inev) = eventp->requestor; |
SELECTION_EVENT_REQUESTOR (&inev.sie) = eventp->requestor; |
5959 |
SELECTION_EVENT_SELECTION (&inev) = eventp->selection; |
SELECTION_EVENT_SELECTION (&inev.sie) = eventp->selection; |
5960 |
SELECTION_EVENT_TARGET (&inev) = eventp->target; |
SELECTION_EVENT_TARGET (&inev.sie) = eventp->target; |
5961 |
SELECTION_EVENT_PROPERTY (&inev) = eventp->property; |
SELECTION_EVENT_PROPERTY (&inev.sie) = eventp->property; |
5962 |
SELECTION_EVENT_TIME (&inev) = eventp->time; |
SELECTION_EVENT_TIME (&inev.sie) = eventp->time; |
5963 |
inev.frame_or_window = Qnil; |
inev.ie.frame_or_window = Qnil; |
5964 |
} |
} |
5965 |
break; |
break; |
5966 |
|
|
6099 |
{ |
{ |
6100 |
f->async_iconified = 1; |
f->async_iconified = 1; |
6101 |
|
|
6102 |
inev.kind = ICONIFY_EVENT; |
inev.ie.kind = ICONIFY_EVENT; |
6103 |
XSETFRAME (inev.frame_or_window, f); |
XSETFRAME (inev.ie.frame_or_window, f); |
6104 |
} |
} |
6105 |
} |
} |
6106 |
goto OTHER; |
goto OTHER; |
6132 |
|
|
6133 |
if (f->iconified) |
if (f->iconified) |
6134 |
{ |
{ |
6135 |
inev.kind = DEICONIFY_EVENT; |
inev.ie.kind = DEICONIFY_EVENT; |
6136 |
XSETFRAME (inev.frame_or_window, f); |
XSETFRAME (inev.ie.frame_or_window, f); |
6137 |
} |
} |
6138 |
else if (! NILP (Vframe_list) |
else if (! NILP (Vframe_list) |
6139 |
&& ! NILP (XCDR (Vframe_list))) |
&& ! NILP (XCDR (Vframe_list))) |
6299 |
orig_keysym = keysym; |
orig_keysym = keysym; |
6300 |
|
|
6301 |
/* Common for all keysym input events. */ |
/* Common for all keysym input events. */ |
6302 |
XSETFRAME (inev.frame_or_window, f); |
XSETFRAME (inev.ie.frame_or_window, f); |
6303 |
inev.modifiers |
inev.ie.modifiers |
6304 |
= x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); |
= x_x_to_emacs_modifiers (FRAME_X_DISPLAY_INFO (f), modifiers); |
6305 |
inev.timestamp = event.xkey.time; |
inev.ie.timestamp = event.xkey.time; |
6306 |
|
|
6307 |
/* First deal with keysyms which have defined |
/* First deal with keysyms which have defined |
6308 |
translations to characters. */ |
translations to characters. */ |
6309 |
if (keysym >= 32 && keysym < 128) |
if (keysym >= 32 && keysym < 128) |
6310 |
/* Avoid explicitly decoding each ASCII character. */ |
/* Avoid explicitly decoding each ASCII character. */ |
6311 |
{ |
{ |
6312 |
inev.kind = ASCII_KEYSTROKE_EVENT; |
inev.ie.kind = ASCII_KEYSTROKE_EVENT; |
6313 |
inev.code = keysym; |
inev.ie.code = keysym; |
6314 |
goto done_keysym; |
goto done_keysym; |
6315 |
} |
} |
6316 |
|
|
6320 |
Vx_keysym_table, |
Vx_keysym_table, |
6321 |
Qnil)))) |
Qnil)))) |
6322 |
{ |
{ |
6323 |
inev.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) |
inev.ie.kind = (SINGLE_BYTE_CHAR_P (XFASTINT (c)) |
6324 |
? ASCII_KEYSTROKE_EVENT |
? ASCII_KEYSTROKE_EVENT |
6325 |
: MULTIBYTE_CHAR_KEYSTROKE_EVENT); |
: MULTIBYTE_CHAR_KEYSTROKE_EVENT); |
6326 |
inev.code = XFASTINT (c); |
inev.ie.code = XFASTINT (c); |
6327 |
goto done_keysym; |
goto done_keysym; |
6328 |
} |
} |
6329 |
|
|
6413 |
STORE_KEYSYM_FOR_DEBUG (keysym); |
STORE_KEYSYM_FOR_DEBUG (keysym); |
6414 |
/* make_lispy_event will convert this to a symbolic |
/* make_lispy_event will convert this to a symbolic |
6415 |
key. */ |
key. */ |
6416 |
inev.kind = NON_ASCII_KEYSTROKE_EVENT; |
inev.ie.kind = NON_ASCII_KEYSTROKE_EVENT; |
6417 |
inev.code = keysym; |
inev.ie.code = keysym; |
6418 |
goto done_keysym; |
goto done_keysym; |
6419 |
} |
} |
6420 |
|
|
6465 |
else |
else |
6466 |
c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, |
c = STRING_CHAR_AND_LENGTH (copy_bufptr + i, |
6467 |
nbytes - i, len); |
nbytes - i, len); |
6468 |
inev.kind = (SINGLE_BYTE_CHAR_P (c) |
inev.ie.kind = (SINGLE_BYTE_CHAR_P (c) |
6469 |
? ASCII_KEYSTROKE_EVENT |
? ASCII_KEYSTROKE_EVENT |
6470 |
: MULTIBYTE_CHAR_KEYSTROKE_EVENT); |
: MULTIBYTE_CHAR_KEYSTROKE_EVENT); |
6471 |
inev.code = c; |
inev.ie.code = c; |
6472 |
kbd_buffer_store_event_hold (&inev, hold_quit); |
kbd_buffer_store_event_hold (&inev.ie, hold_quit); |
6473 |
} |
} |
6474 |
|
|
6475 |
/* Previous code updated count by nchars rather than nbytes, |
/* Previous code updated count by nchars rather than nbytes, |
6476 |
but that seems bogus to me. ++kfs */ |
but that seems bogus to me. ++kfs */ |
6477 |
count += nbytes; |
count += nbytes; |
6478 |
|
|
6479 |
inev.kind = NO_EVENT; /* Already stored above. */ |
inev.ie.kind = NO_EVENT; /* Already stored above. */ |
6480 |
|
|
6481 |
if (keysym == NoSymbol) |
if (keysym == NoSymbol) |
6482 |
break; |
break; |
6503 |
#endif |
#endif |
6504 |
|
|
6505 |
case EnterNotify: |
case EnterNotify: |
6506 |
x_detect_focus_change (dpyinfo, &event, &inev); |
x_detect_focus_change (dpyinfo, &event, &inev.ie); |
6507 |
|
|
6508 |
f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
f = x_any_window_to_frame (dpyinfo, event.xcrossing.window); |
6509 |
|
|
6533 |
goto OTHER; |
goto OTHER; |
6534 |
|
|
6535 |
case FocusIn: |
case FocusIn: |
6536 |
x_detect_focus_change (dpyinfo, &event, &inev); |
x_detect_focus_change (dpyinfo, &event, &inev.ie); |
6537 |
goto OTHER; |
goto OTHER; |
6538 |
|
|
6539 |
case LeaveNotify: |
case LeaveNotify: |
6540 |
x_detect_focus_change (dpyinfo, &event, &inev); |
x_detect_focus_change (dpyinfo, &event, &inev.ie); |
6541 |
|
|
6542 |
f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
6543 |
if (f) |
if (f) |
6560 |
goto OTHER; |
goto OTHER; |
6561 |
|
|
6562 |
case FocusOut: |
case FocusOut: |
6563 |
x_detect_focus_change (dpyinfo, &event, &inev); |
x_detect_focus_change (dpyinfo, &event, &inev.ie); |
6564 |
goto OTHER; |
goto OTHER; |
6565 |
|
|
6566 |
case MotionNotify: |
case MotionNotify: |
6600 |
&& !EQ (window, last_window) |
&& !EQ (window, last_window) |
6601 |
&& !EQ (window, selected_window)) |
&& !EQ (window, selected_window)) |
6602 |
{ |
{ |
6603 |
inev.kind = SELECT_WINDOW_EVENT; |
inev.ie.kind = SELECT_WINDOW_EVENT; |
6604 |
inev.frame_or_window = window; |
inev.ie.frame_or_window = window; |
6605 |
} |
} |
6606 |
|
|
6607 |
last_window=window; |
last_window=window; |
6760 |
&& (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) |
&& (int)(event.xbutton.time - ignore_next_mouse_click_timeout) > 0) |
6761 |
{ |
{ |
6762 |
ignore_next_mouse_click_timeout = 0; |
ignore_next_mouse_click_timeout = 0; |
6763 |
construct_mouse_click (&inev, &event, f); |
construct_mouse_click (&inev.ie, &event, f); |
6764 |
} |
} |
6765 |
if (event.type == ButtonRelease) |
if (event.type == ButtonRelease) |
6766 |
ignore_next_mouse_click_timeout = 0; |
ignore_next_mouse_click_timeout = 0; |
6767 |
} |
} |
6768 |
else |
else |
6769 |
construct_mouse_click (&inev, &event, f); |
construct_mouse_click (&inev.ie, &event, f); |
6770 |
} |
} |
6771 |
} |
} |
6772 |
} |
} |
6781 |
scroll bars. */ |
scroll bars. */ |
6782 |
if (bar && event.xbutton.state & ControlMask) |
if (bar && event.xbutton.state & ControlMask) |
6783 |
{ |
{ |
6784 |
x_scroll_bar_handle_click (bar, &event, &inev); |
x_scroll_bar_handle_click (bar, &event, &inev.ie); |
6785 |
*finish = X_EVENT_DROP; |
*finish = X_EVENT_DROP; |
6786 |
} |
} |
6787 |
#else /* not USE_TOOLKIT_SCROLL_BARS */ |
#else /* not USE_TOOLKIT_SCROLL_BARS */ |
6788 |
if (bar) |
if (bar) |
6789 |
x_scroll_bar_handle_click (bar, &event, &inev); |
x_scroll_bar_handle_click (bar, &event, &inev.ie); |
6790 |
#endif /* not USE_TOOLKIT_SCROLL_BARS */ |
#endif /* not USE_TOOLKIT_SCROLL_BARS */ |
6791 |
} |
} |
6792 |
|
|
6894 |
} |
} |
6895 |
|
|
6896 |
done: |
done: |
6897 |
if (inev.kind != NO_EVENT) |
if (inev.ie.kind != NO_EVENT) |
6898 |
{ |
{ |
6899 |
kbd_buffer_store_event_hold (&inev, hold_quit); |
kbd_buffer_store_event_hold (&inev.ie, hold_quit); |
6900 |
count++; |
count++; |
6901 |
} |
} |
6902 |
|
|