|
Lines 334-352
static void
Link Here
|
| 334 |
TransferXEventsToTcl( |
334 |
TransferXEventsToTcl( |
| 335 |
Display *display) |
335 |
Display *display) |
| 336 |
{ |
336 |
{ |
| 337 |
int numFound; |
|
|
| 338 |
XEvent event; |
337 |
XEvent event; |
| 339 |
|
338 |
|
| 340 |
numFound = QLength(display); |
|
|
| 341 |
|
| 342 |
/* |
339 |
/* |
| 343 |
* Transfer events from the X event queue to the Tk event queue. |
340 |
* Transfer events from the X event queue to the Tk event queue |
|
|
341 |
* after XIM event filtering. KeyPress and KeyRelease events |
| 342 |
* are filtered in Tk_HandleEvent instead of here, so that Tk's |
| 343 |
* focus management code can redirect them. |
| 344 |
*/ |
344 |
*/ |
| 345 |
|
345 |
while (QLength(display) > 0) { |
| 346 |
while (numFound > 0) { |
|
|
| 347 |
XNextEvent(display, &event); |
346 |
XNextEvent(display, &event); |
|
|
347 |
if (event.type != KeyPress && event.type != KeyRelease) { |
| 348 |
if (XFilterEvent(&event, None)) { |
| 349 |
continue; |
| 350 |
} |
| 351 |
} |
| 348 |
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); |
352 |
Tk_QueueWindowEvent(&event, TCL_QUEUE_TAIL); |
| 349 |
numFound--; |
|
|
| 350 |
} |
353 |
} |
| 351 |
} |
354 |
} |
| 352 |
|
355 |
|
|
Lines 636-666
OpenIM(
Link Here
|
| 636 |
{ |
639 |
{ |
| 637 |
unsigned short i; |
640 |
unsigned short i; |
| 638 |
XIMStyles *stylePtr; |
641 |
XIMStyles *stylePtr; |
| 639 |
char *modifiers; |
|
|
| 640 |
|
642 |
|
| 641 |
modifiers = XSetLocaleModifiers(""); |
643 |
if (XSetLocaleModifiers("") == NULL) { |
| 642 |
if (modifiers == NULL) { |
|
|
| 643 |
goto error; |
644 |
goto error; |
| 644 |
} |
645 |
} |
| 645 |
#if 1 |
|
|
| 646 |
/* |
| 647 |
* This is a temporary hack that can be taken back out again |
| 648 |
* once Tk has learned how to deal with SCIM |
| 649 |
*/ |
| 650 |
while ((modifiers = strchr(modifiers, '@')) != NULL) { |
| 651 |
if (strncmp(modifiers, "@im=", 4) == 0) { |
| 652 |
/* The first "@im=" entry wins */ |
| 653 |
const char *scim = "@im=SCIM"; |
| 654 |
if (strncmp(modifiers, scim, strlen(scim)) == 0) { |
| 655 |
/* If it is SCIM, we override it */ |
| 656 |
if (XSetLocaleModifiers("@im=local") == NULL) { |
| 657 |
goto error; |
| 658 |
} |
| 659 |
} |
| 660 |
break; |
| 661 |
} |
| 662 |
} |
| 663 |
#endif |
| 664 |
|
646 |
|
| 665 |
dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL); |
647 |
dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL); |
| 666 |
if (dispPtr->inputMethod == NULL) { |
648 |
if (dispPtr->inputMethod == NULL) { |