… | |
… | |
355 | |
355 | |
356 | init_xlocale (); |
356 | init_xlocale (); |
357 | |
357 | |
358 | scr_reset (); /* initialize screen */ |
358 | scr_reset (); /* initialize screen */ |
359 | |
359 | |
360 | #if 0 |
360 | #if 1 |
361 | XSynchronize (display->display, True); |
361 | XSynchronize (display->display, True); |
362 | #endif |
362 | #endif |
363 | |
363 | |
364 | #ifdef HAVE_SCROLLBARS |
364 | #ifdef HAVE_SCROLLBARS |
365 | if (options & Opt_scrollBar) |
365 | if (options & Opt_scrollBar) |
… | |
… | |
1299 | { |
1299 | { |
1300 | im_destroy (); |
1300 | im_destroy (); |
1301 | return false; |
1301 | return false; |
1302 | } |
1302 | } |
1303 | |
1303 | |
1304 | p = rs[Rs_preeditType] ? rs[Rs_preeditType] : "OverTheSpot,OffTheSpot,Root,None"; |
1304 | const char *pet[] = { rs[Rs_preeditType], "OverTheSpot,OffTheSpot,Root,None" }; |
|
|
1305 | |
|
|
1306 | for (int pi = 0; pi < 2; pi++) |
|
|
1307 | { |
|
|
1308 | p = pet[pi]; |
|
|
1309 | |
|
|
1310 | if (!p) |
|
|
1311 | continue; |
|
|
1312 | |
1305 | s = rxvt_splitcommastring (p); |
1313 | s = rxvt_splitcommastring (p); |
1306 | |
1314 | |
1307 | for (i = found = 0; !found && s[i]; i++) |
1315 | for (i = found = 0; !found && s[i]; i++) |
1308 | { |
1316 | { |
1309 | if (!strcmp (s[i], "OverTheSpot")) |
1317 | if (!strcmp (s[i], "OverTheSpot")) |
1310 | input_style = (XIMPreeditPosition | XIMStatusNothing); |
1318 | input_style = (XIMPreeditPosition | XIMStatusNothing); |
1311 | else if (!strcmp (s[i], "OffTheSpot")) |
1319 | else if (!strcmp (s[i], "OffTheSpot")) |
1312 | input_style = (XIMPreeditArea | XIMStatusArea); |
1320 | input_style = (XIMPreeditArea | XIMStatusArea); |
1313 | else if (!strcmp (s[i], "Root")) |
1321 | else if (!strcmp (s[i], "Root")) |
1314 | input_style = (XIMPreeditNothing | XIMStatusNothing); |
1322 | input_style = (XIMPreeditNothing | XIMStatusNothing); |
1315 | else if (!strcmp (s[i], "None")) |
1323 | else if (!strcmp (s[i], "None")) |
1316 | input_style = (XIMPreeditNone | XIMStatusNone); |
1324 | input_style = (XIMPreeditNone | XIMStatusNone); |
1317 | |
1325 | |
1318 | for (j = 0; j < xim_styles->count_styles; j++) |
1326 | for (j = 0; j < xim_styles->count_styles; j++) |
1319 | if (input_style == xim_styles->supported_styles[j]) |
1327 | if (input_style == xim_styles->supported_styles[j]) |
1320 | { |
1328 | { |
|
|
1329 | rxvt_freecommastring (s); |
|
|
1330 | |
1321 | found = 1; |
1331 | found = 1; |
1322 | break; |
1332 | goto foundpet; |
|
|
1333 | } |
|
|
1334 | |
1323 | } |
1335 | } |
1324 | } |
|
|
1325 | |
1336 | |
1326 | for (i = 0; s[i]; i++) |
1337 | rxvt_freecommastring (s); |
1327 | free (s[i]); |
1338 | } |
1328 | |
1339 | |
1329 | free (s); |
1340 | foundpet: |
|
|
1341 | |
1330 | XFree (xim_styles); |
1342 | XFree (xim_styles); |
1331 | |
1343 | |
1332 | if (!found) |
1344 | if (!found) |
1333 | { |
1345 | { |
1334 | im_destroy (); |
1346 | im_destroy (); |
… | |
… | |
1459 | if (p && *p) |
1471 | if (p && *p) |
1460 | { |
1472 | { |
1461 | bool found = false; |
1473 | bool found = false; |
1462 | |
1474 | |
1463 | s = rxvt_splitcommastring (p); |
1475 | s = rxvt_splitcommastring (p); |
|
|
1476 | |
1464 | for (i = 0; s[i]; i++) |
1477 | for (i = 0; s[i]; i++) |
1465 | { |
1478 | { |
1466 | if (*s[i]) |
1479 | if (*s[i]) |
1467 | { |
1480 | { |
1468 | strcpy (buf, "@im="); |
1481 | strcpy (buf, "@im="); |
… | |
… | |
1472 | found = true; |
1485 | found = true; |
1473 | break; |
1486 | break; |
1474 | } |
1487 | } |
1475 | } |
1488 | } |
1476 | } |
1489 | } |
1477 | for (i = 0; s[i]; i++) |
1490 | |
1478 | free (s[i]); |
1491 | rxvt_freecommastring (s); |
1479 | free (s); |
|
|
1480 | |
1492 | |
1481 | if (found) |
1493 | if (found) |
1482 | goto done; |
1494 | goto done; |
1483 | } |
1495 | } |
1484 | |
1496 | |