Mercurial > emacs
comparison src/xterm.c @ 13898:dceb33c07f9e
(XTread_socket): Pass KeyPress events to the toolkit.
Make the OTHER label exist unconditionally, and make the gotos
unconditional when that is convenient.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 31 Dec 1995 19:10:03 +0000 |
parents | 26245345f6f1 |
children | 65e51231924e |
comparison
equal
deleted
inserted
replaced
13897:1960e2c77da7 | 13898:dceb33c07f9e |
---|---|
3589 XSETFRAME (bufp->frame_or_window, f); | 3589 XSETFRAME (bufp->frame_or_window, f); |
3590 bufp++; | 3590 bufp++; |
3591 count++; | 3591 count++; |
3592 numchars--; | 3592 numchars--; |
3593 } | 3593 } |
3594 #ifdef USE_X_TOOLKIT | |
3595 goto OTHER; | 3594 goto OTHER; |
3596 #endif /* USE_X_TOOLKIT */ | |
3597 break; | |
3598 | 3595 |
3599 case MapNotify: | 3596 case MapNotify: |
3600 /* We use x_top_window_to_frame because map events can come | 3597 /* We use x_top_window_to_frame because map events can come |
3601 for subwindows and they don't mean that the frame is visible. */ | 3598 for subwindows and they don't mean that the frame is visible. */ |
3602 f = x_top_window_to_frame (dpyinfo, event.xmap.window); | 3599 f = x_top_window_to_frame (dpyinfo, event.xmap.window); |
3621 /* Force a redisplay sooner or later | 3618 /* Force a redisplay sooner or later |
3622 to update the frame titles | 3619 to update the frame titles |
3623 in case this is the second frame. */ | 3620 in case this is the second frame. */ |
3624 record_asynch_buffer_change (); | 3621 record_asynch_buffer_change (); |
3625 } | 3622 } |
3626 #ifdef USE_X_TOOLKIT | |
3627 goto OTHER; | 3623 goto OTHER; |
3628 #endif /* USE_X_TOOLKIT */ | |
3629 break; | |
3630 | 3624 |
3631 /* Turn off processing if we become fully obscured. */ | 3625 /* Turn off processing if we become fully obscured. */ |
3632 case VisibilityNotify: | 3626 case VisibilityNotify: |
3633 break; | 3627 break; |
3634 | 3628 |
3788 abort (); | 3782 abort (); |
3789 } | 3783 } |
3790 else | 3784 else |
3791 abort (); | 3785 abort (); |
3792 } | 3786 } |
3793 break; | 3787 goto OTHER; |
3794 | 3788 |
3795 /* Here's a possible interpretation of the whole | 3789 /* Here's a possible interpretation of the whole |
3796 FocusIn-EnterNotify FocusOut-LeaveNotify mess. If you get a | 3790 FocusIn-EnterNotify FocusOut-LeaveNotify mess. If you get a |
3797 FocusIn event, you have to get a FocusOut event before you | 3791 FocusIn event, you have to get a FocusOut event before you |
3798 relinquish the focus. If you haven't received a FocusIn event, | 3792 relinquish the focus. If you haven't received a FocusIn event, |
3816 x_new_focus_frame (dpyinfo, 0); | 3810 x_new_focus_frame (dpyinfo, 0); |
3817 /* EnterNotify counts as mouse movement, | 3811 /* EnterNotify counts as mouse movement, |
3818 so update things that depend on mouse position. */ | 3812 so update things that depend on mouse position. */ |
3819 if (f) | 3813 if (f) |
3820 note_mouse_movement (f, &event.xmotion); | 3814 note_mouse_movement (f, &event.xmotion); |
3821 #ifdef USE_X_TOOLKIT | |
3822 goto OTHER; | 3815 goto OTHER; |
3823 #endif /* USE_X_TOOLKIT */ | |
3824 break; | |
3825 | 3816 |
3826 case FocusIn: | 3817 case FocusIn: |
3827 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); | 3818 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); |
3828 if (event.xfocus.detail != NotifyPointer) | 3819 if (event.xfocus.detail != NotifyPointer) |
3829 dpyinfo->x_focus_event_frame = f; | 3820 dpyinfo->x_focus_event_frame = f; |
3833 #ifdef HAVE_X_I18N | 3824 #ifdef HAVE_X_I18N |
3834 if (f && FRAME_XIC (f)) | 3825 if (f && FRAME_XIC (f)) |
3835 XSetICFocus (FRAME_XIC (f)); | 3826 XSetICFocus (FRAME_XIC (f)); |
3836 #endif | 3827 #endif |
3837 | 3828 |
3838 #ifdef USE_X_TOOLKIT | |
3839 goto OTHER; | 3829 goto OTHER; |
3840 #endif /* USE_X_TOOLKIT */ | |
3841 break; | |
3842 | |
3843 | 3830 |
3844 case LeaveNotify: | 3831 case LeaveNotify: |
3845 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); | 3832 f = x_top_window_to_frame (dpyinfo, event.xcrossing.window); |
3846 if (f) | 3833 if (f) |
3847 { | 3834 { |
3858 dpyinfo->x_focus_event_frame = 0; | 3845 dpyinfo->x_focus_event_frame = 0; |
3859 if (f == dpyinfo->x_focus_frame) | 3846 if (f == dpyinfo->x_focus_frame) |
3860 x_new_focus_frame (dpyinfo, 0); | 3847 x_new_focus_frame (dpyinfo, 0); |
3861 } | 3848 } |
3862 } | 3849 } |
3863 #ifdef USE_X_TOOLKIT | |
3864 goto OTHER; | 3850 goto OTHER; |
3865 #endif /* USE_X_TOOLKIT */ | |
3866 break; | |
3867 | 3851 |
3868 case FocusOut: | 3852 case FocusOut: |
3869 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); | 3853 f = x_any_window_to_frame (dpyinfo, event.xfocus.window); |
3870 if (event.xfocus.detail != NotifyPointer | 3854 if (event.xfocus.detail != NotifyPointer |
3871 && f == dpyinfo->x_focus_event_frame) | 3855 && f == dpyinfo->x_focus_event_frame) |
3876 #ifdef HAVE_X_I18N | 3860 #ifdef HAVE_X_I18N |
3877 if (f && FRAME_XIC (f)) | 3861 if (f && FRAME_XIC (f)) |
3878 XUnsetICFocus (FRAME_XIC (f)); | 3862 XUnsetICFocus (FRAME_XIC (f)); |
3879 #endif | 3863 #endif |
3880 | 3864 |
3881 #ifdef USE_X_TOOLKIT | |
3882 goto OTHER; | 3865 goto OTHER; |
3883 #endif /* USE_X_TOOLKIT */ | |
3884 break; | |
3885 | 3866 |
3886 case MotionNotify: | 3867 case MotionNotify: |
3887 { | 3868 { |
3888 if (dpyinfo->grabbed && last_mouse_frame | 3869 if (dpyinfo->grabbed && last_mouse_frame |
3889 && FRAME_LIVE_P (last_mouse_frame)) | 3870 && FRAME_LIVE_P (last_mouse_frame)) |
3903 /* If we move outside the frame, | 3884 /* If we move outside the frame, |
3904 then we're certainly no longer on any text in the frame. */ | 3885 then we're certainly no longer on any text in the frame. */ |
3905 clear_mouse_face (dpyinfo); | 3886 clear_mouse_face (dpyinfo); |
3906 } | 3887 } |
3907 } | 3888 } |
3908 #ifdef USE_X_TOOLKIT | |
3909 goto OTHER; | 3889 goto OTHER; |
3910 #endif /* USE_X_TOOLKIT */ | |
3911 break; | |
3912 | 3890 |
3913 case ConfigureNotify: | 3891 case ConfigureNotify: |
3914 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window); | 3892 f = x_any_window_to_frame (dpyinfo, event.xconfigure.window); |
3915 if (f | 3893 if (f |
3916 #ifdef USE_X_TOOLKIT | 3894 #ifdef USE_X_TOOLKIT |
3995 x_wm_set_size_hint (f, (long) 0, 0); | 3973 x_wm_set_size_hint (f, (long) 0, 0); |
3996 } | 3974 } |
3997 /* #endif */ | 3975 /* #endif */ |
3998 } | 3976 } |
3999 } | 3977 } |
4000 #ifdef USE_X_TOOLKIT | |
4001 goto OTHER; | 3978 goto OTHER; |
4002 #else | |
4003 break; | |
4004 #endif | |
4005 | 3979 |
4006 case ButtonPress: | 3980 case ButtonPress: |
4007 case ButtonRelease: | 3981 case ButtonRelease: |
4008 { | 3982 { |
4009 /* If we decide we want to generate an event to be seen | 3983 /* If we decide we want to generate an event to be seen |
4101 x_find_modifier_meanings (dpyinfo); | 4075 x_find_modifier_meanings (dpyinfo); |
4102 /* This is meant to fall through. */ | 4076 /* This is meant to fall through. */ |
4103 case MappingKeyboard: | 4077 case MappingKeyboard: |
4104 XRefreshKeyboardMapping (&event.xmapping); | 4078 XRefreshKeyboardMapping (&event.xmapping); |
4105 } | 4079 } |
4080 goto OTHER; | |
4081 | |
4082 default: | |
4083 OTHER: | |
4106 #ifdef USE_X_TOOLKIT | 4084 #ifdef USE_X_TOOLKIT |
4107 goto OTHER; | |
4108 #endif /* USE_X_TOOLKIT */ | |
4109 break; | |
4110 | |
4111 default: | |
4112 #ifdef USE_X_TOOLKIT | |
4113 OTHER: | |
4114 BLOCK_INPUT; | 4085 BLOCK_INPUT; |
4115 XtDispatchEvent (&event); | 4086 XtDispatchEvent (&event); |
4116 UNBLOCK_INPUT; | 4087 UNBLOCK_INPUT; |
4117 #endif /* USE_X_TOOLKIT */ | 4088 #endif /* USE_X_TOOLKIT */ |
4118 break; | 4089 break; |