comparison src/xterm.c @ 6010:1f9f36411af8

(XTread_socket--cases KeyPress, EnterNotify, LeaveNotify) (cases FocusIn, FocusOut): Use x_any_window_to_frame.
author Richard M. Stallman <rms@gnu.org>
date Sat, 19 Feb 1994 22:56:21 +0000
parents 040bdc2fec7c
children 713d4d840a11
comparison
equal deleted inserted replaced
6009:f68004daa523 6010:1f9f36411af8
3142 break; 3142 break;
3143 #endif /* ! defined (HAVE_X11) */ 3143 #endif /* ! defined (HAVE_X11) */
3144 3144
3145 #ifdef HAVE_X11 3145 #ifdef HAVE_X11
3146 case KeyPress: 3146 case KeyPress:
3147 f = x_window_to_frame (event.xkey.window); 3147 f = x_any_window_to_frame (event.xkey.window);
3148 3148
3149 if (f != 0) 3149 if (f != 0)
3150 { 3150 {
3151 KeySym keysym, orig_keysym; 3151 KeySym keysym, orig_keysym;
3152 /* al%imercury@uunet.uu.net says that making this 81 instead of 3152 /* al%imercury@uunet.uu.net says that making this 81 instead of
3335 FocusIn event, you have to get a FocusOut event before you 3335 FocusIn event, you have to get a FocusOut event before you
3336 relinquish the focus. If you haven't received a FocusIn event, 3336 relinquish the focus. If you haven't received a FocusIn event,
3337 then a mere LeaveNotify is enough to free you. */ 3337 then a mere LeaveNotify is enough to free you. */
3338 3338
3339 case EnterNotify: 3339 case EnterNotify:
3340 f = x_window_to_frame (event.xcrossing.window); 3340 f = x_any_window_to_frame (event.xcrossing.window);
3341 3341
3342 if (event.xcrossing.focus) /* Entered Window */ 3342 if (event.xcrossing.focus) /* Entered Window */
3343 { 3343 {
3344 /* Avoid nasty pop/raise loops. */ 3344 /* Avoid nasty pop/raise loops. */
3345 if (f && (!(f->auto_raise) 3345 if (f && (!(f->auto_raise)
3356 goto OTHER; 3356 goto OTHER;
3357 #endif /* USE_X_TOOLKIT */ 3357 #endif /* USE_X_TOOLKIT */
3358 break; 3358 break;
3359 3359
3360 case FocusIn: 3360 case FocusIn:
3361 f = x_window_to_frame (event.xfocus.window); 3361 f = x_any_window_to_frame (event.xfocus.window);
3362 if (event.xfocus.detail != NotifyPointer) 3362 if (event.xfocus.detail != NotifyPointer)
3363 x_focus_event_frame = f; 3363 x_focus_event_frame = f;
3364 if (f) 3364 if (f)
3365 x_new_focus_frame (f); 3365 x_new_focus_frame (f);
3366 #ifdef USE_X_TOOLKIT 3366 #ifdef USE_X_TOOLKIT
3368 #endif /* USE_X_TOOLKIT */ 3368 #endif /* USE_X_TOOLKIT */
3369 break; 3369 break;
3370 3370
3371 3371
3372 case LeaveNotify: 3372 case LeaveNotify:
3373 f = x_window_to_frame (event.xcrossing.window); 3373 f = x_any_window_to_frame (event.xcrossing.window);
3374 3374
3375 if (event.xcrossing.focus) 3375 if (event.xcrossing.focus)
3376 { 3376 {
3377 if (! x_focus_event_frame) 3377 if (! x_focus_event_frame)
3378 x_new_focus_frame (0); 3378 x_new_focus_frame (0);
3390 goto OTHER; 3390 goto OTHER;
3391 #endif /* USE_X_TOOLKIT */ 3391 #endif /* USE_X_TOOLKIT */
3392 break; 3392 break;
3393 3393
3394 case FocusOut: 3394 case FocusOut:
3395 f = x_window_to_frame (event.xfocus.window); 3395 f = x_any_window_to_frame (event.xfocus.window);
3396 if (event.xfocus.detail != NotifyPointer 3396 if (event.xfocus.detail != NotifyPointer
3397 && f == x_focus_event_frame) 3397 && f == x_focus_event_frame)
3398 x_focus_event_frame = 0; 3398 x_focus_event_frame = 0;
3399 if (f && f == x_focus_frame) 3399 if (f && f == x_focus_frame)
3400 x_new_focus_frame (0); 3400 x_new_focus_frame (0);