comparison src/event-Xt.c @ 422:95016f13131a r21-2-19

Import from CVS: tag r21-2-19
author cvs
date Mon, 13 Aug 2007 11:25:01 +0200
parents 41dbb7a9d5f2
children 11054d720c21
comparison
equal deleted inserted replaced
421:fff06e11db74 422:95016f13131a
1312 handle_focus_event_1 (struct frame *f, int in_p) 1312 handle_focus_event_1 (struct frame *f, int in_p)
1313 { 1313 {
1314 #if XtSpecificationRelease > 5 1314 #if XtSpecificationRelease > 5
1315 Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f)); 1315 Widget focus_widget = XtGetKeyboardFocusWidget (FRAME_X_TEXT_WIDGET (f));
1316 #endif 1316 #endif
1317 #if defined(HAVE_XIM) && defined(XIM_XLIB) 1317 #ifdef HAVE_XIM
1318 if (FRAME_X_XIC(f)) 1318 XIM_focus_event (f, in_p);
1319 XIM_focus_event (f, in_p);
1320 #endif /* HAVE_XIM */ 1319 #endif /* HAVE_XIM */
1321 1320
1322 /* On focus change, clear all memory of sticky modifiers 1321 /* On focus change, clear all memory of sticky modifiers
1323 to avoid non-intuitive behavior. */ 1322 to avoid non-intuitive behavior. */
1324 clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f))); 1323 clear_sticky_modifiers (XDEVICE (FRAME_DEVICE (f)));
1332 select-frame stuff until after the sit-for. 1331 select-frame stuff until after the sit-for.
1333 1332
1334 Unfortunately native widgets break the model because they grab 1333 Unfortunately native widgets break the model because they grab
1335 the keyboard focus and nothing sets it back again. I cannot find 1334 the keyboard focus and nothing sets it back again. I cannot find
1336 any reasonable way to do this elsewhere so we assert here that 1335 any reasonable way to do this elsewhere so we assert here that
1337 the keybpard focus is on the emacs text widget. Menus and dialogs 1336 the keyboard focus is on the emacs text widget. Menus and dialogs
1338 do this in their selection callback, but we don't want that since 1337 do this in their selection callback, but we don't want that since
1339 a button having focus is legitimate. An edit field having focus 1338 a button having focus is legitimate. An edit field having focus
1340 is mandatory. Weirdly you get a FocusOut event when you glick in 1339 is mandatory. Weirdly you get a FocusOut event when you click in
1341 a widget-glyph but you don't get a correspondng FocusIn when you 1340 a widget-glyph but you don't get a correspondng FocusIn when you
1342 click in the frame. Why is this? */ 1341 click in the frame. Why is this? */
1343 if (in_p 1342 if (in_p
1344 #if XtSpecificationRelease > 5 1343 #if XtSpecificationRelease > 5
1345 && FRAME_X_TEXT_WIDGET (f) != focus_widget 1344 && FRAME_X_TEXT_WIDGET (f) != focus_widget
1642 != VisibilityFullyObscured) ? 1 : -1); 1641 != VisibilityFullyObscured) ? 1 : -1);
1643 } 1642 }
1644 break; 1643 break;
1645 1644
1646 case ConfigureNotify: 1645 case ConfigureNotify:
1647 #if defined(HAVE_XIM) && defined(XIM_XLIB) 1646 #ifdef HAVE_XIM
1648 if (FRAME_X_XIC(f)) 1647 XIM_SetGeometry (f);
1649 XIM_SetGeometry (f);
1650 #endif 1648 #endif
1651 break; 1649 break;
1652 1650
1653 default: 1651 default:
1654 break; 1652 break;