… | |
… | |
271 | for (int i = 0; i < allocated.size (); i++) |
271 | for (int i = 0; i < allocated.size (); i++) |
272 | free (allocated [i]); |
272 | free (allocated [i]); |
273 | |
273 | |
274 | free (selection.text); |
274 | free (selection.text); |
275 | // TODO: manage env vars in child only(!) |
275 | // TODO: manage env vars in child only(!) |
276 | free (env_windowid); |
|
|
277 | free (env_display); |
276 | free (env_display); |
278 | free (env_term); |
277 | free (env_term); |
279 | free (env_colorfgbg); |
|
|
280 | free (locale); |
278 | free (locale); |
281 | free (v_buffer); |
279 | free (v_buffer); |
282 | free (incr_buf); |
280 | free (incr_buf); |
283 | |
281 | |
284 | delete envv; |
282 | delete envv; |
… | |
… | |
513 | |
511 | |
514 | check_ev.start (); |
512 | check_ev.start (); |
515 | |
513 | |
516 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
514 | HOOK_INVOKE ((this, HOOK_START, DT_END)); |
517 | |
515 | |
|
|
516 | #if ENABLE_XEMBED |
|
|
517 | if (rs[Rs_embed]) |
|
|
518 | { |
|
|
519 | long info[2] = { 0, XEMBED_MAPPED }; |
|
|
520 | |
|
|
521 | XChangeProperty (display->display, parent[0], xa[XA_XEMBED_INFO], xa[XA_XEMBED_INFO], |
|
|
522 | 32, PropModeReplace, (unsigned char *)&info, 2); |
|
|
523 | } |
|
|
524 | #endif |
|
|
525 | |
518 | XMapWindow (disp, vt); |
526 | XMapWindow (disp, vt); |
519 | XMapWindow (disp, parent[0]); |
527 | XMapWindow (disp, parent[0]); |
520 | |
528 | |
521 | return true; |
529 | return true; |
522 | } |
530 | } |
… | |
… | |
976 | { |
984 | { |
977 | unsigned int i; |
985 | unsigned int i; |
978 | const char *xpmb = "\0"; |
986 | const char *xpmb = "\0"; |
979 | char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1]; |
987 | char fstr[sizeof ("default") + 1], bstr[sizeof ("default") + 1]; |
980 | |
988 | |
981 | env_colorfgbg = (char *)rxvt_malloc (sizeof ("COLORFGBG=default;default;bg") + 1); |
|
|
982 | strcpy (fstr, "default"); |
989 | strcpy (fstr, "default"); |
983 | strcpy (bstr, "default"); |
990 | strcpy (bstr, "default"); |
984 | for (i = Color_Black; i <= Color_White; i++) |
991 | for (i = Color_Black; i <= Color_White; i++) |
985 | if (pix_colors[Color_fg] == pix_colors[i]) |
992 | if (pix_colors[Color_fg] == pix_colors[i]) |
986 | { |
993 | { |
… | |
… | |
1211 | XPoint nspot; |
1218 | XPoint nspot; |
1212 | XVaNestedList preedit_attr; |
1219 | XVaNestedList preedit_attr; |
1213 | |
1220 | |
1214 | if (!Input_Context |
1221 | if (!Input_Context |
1215 | || !focus |
1222 | || !focus |
1216 | || !(input_style & XIMPreeditPosition)) |
1223 | || !(input_style & (XIMPreeditPosition | XIMPreeditCallbacks))) |
1217 | return; |
1224 | return; |
1218 | |
1225 | |
1219 | im_set_position (nspot); |
1226 | im_set_position (nspot); |
1220 | |
1227 | |
1221 | if (nspot.x == spot.x && nspot.y == spot.y) |
1228 | if (nspot.x == spot.x && nspot.y == spot.y) |
… | |
… | |
1300 | DT_INT, call_data->chg_first, |
1307 | DT_INT, call_data->chg_first, |
1301 | DT_INT, call_data->chg_length, |
1308 | DT_INT, call_data->chg_length, |
1302 | DT_END)); |
1309 | DT_END)); |
1303 | } |
1310 | } |
1304 | |
1311 | |
|
|
1312 | #if 0 |
1305 | static void |
1313 | static void |
1306 | xim_preedit_caret (XIC ic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data) |
1314 | xim_preedit_caret (XIC ic, XPointer client_data, XIMPreeditCaretCallbackStruct *call_data) |
1307 | { |
1315 | { |
1308 | ((rxvt_term *)client_data)->make_current (); |
1316 | ((rxvt_term *)client_data)->make_current (); |
1309 | HOOK_INVOKE (((rxvt_term *)client_data, HOOK_XIM_PREEDIT_CARET, |
1317 | HOOK_INVOKE (((rxvt_term *)client_data, HOOK_XIM_PREEDIT_CARET, |
1310 | DT_INT, call_data->position, |
1318 | DT_INT, call_data->position, |
1311 | DT_INT, call_data->direction, |
1319 | DT_INT, call_data->direction, |
1312 | DT_INT, call_data->style, |
1320 | DT_INT, call_data->style, |
1313 | DT_END)); |
1321 | DT_END)); |
1314 | } |
1322 | } |
|
|
1323 | #endif |
1315 | |
1324 | |
1316 | #endif |
1325 | #endif |
1317 | |
1326 | |
1318 | /* |
1327 | /* |
1319 | * Try to open a XIM with the current modifiers, then see if we can |
1328 | * Try to open a XIM with the current modifiers, then see if we can |
… | |
… | |
1479 | XNFontSet, fs, |
1488 | XNFontSet, fs, |
1480 | NULL); |
1489 | NULL); |
1481 | } |
1490 | } |
1482 | else if (input_style & XIMPreeditCallbacks) |
1491 | else if (input_style & XIMPreeditCallbacks) |
1483 | { |
1492 | { |
|
|
1493 | im_set_position (spot); |
|
|
1494 | |
1484 | xcb[0].client_data = (XPointer)this; xcb[0].callback = (XIMProc)xim_preedit_start; |
1495 | xcb[0].client_data = (XPointer)this; xcb[0].callback = (XIMProc)xim_preedit_start; |
1485 | xcb[1].client_data = (XPointer)this; xcb[1].callback = (XIMProc)xim_preedit_done; |
1496 | xcb[1].client_data = (XPointer)this; xcb[1].callback = (XIMProc)xim_preedit_done; |
1486 | xcb[2].client_data = (XPointer)this; xcb[2].callback = (XIMProc)xim_preedit_draw; |
1497 | xcb[2].client_data = (XPointer)this; xcb[2].callback = (XIMProc)xim_preedit_draw; |
|
|
1498 | #if 0 |
1487 | xcb[3].client_data = (XPointer)this; xcb[3].callback = (XIMProc)xim_preedit_caret; |
1499 | xcb[3].client_data = (XPointer)this; xcb[3].callback = (XIMProc)xim_preedit_caret; |
|
|
1500 | #endif |
1488 | |
1501 | |
1489 | preedit_attr = XVaCreateNestedList (0, |
1502 | preedit_attr = XVaCreateNestedList (0, |
|
|
1503 | XNSpotLocation, &spot, |
1490 | XNPreeditStartCallback, &xcb[0], |
1504 | XNPreeditStartCallback, &xcb[0], |
1491 | XNPreeditDoneCallback , &xcb[1], |
1505 | XNPreeditDoneCallback , &xcb[1], |
1492 | XNPreeditDrawCallback , &xcb[2], |
1506 | XNPreeditDrawCallback , &xcb[2], |
|
|
1507 | #if 0 |
1493 | XNPreeditCaretCallback, &xcb[3], |
1508 | XNPreeditCaretCallback, &xcb[3], |
|
|
1509 | #endif |
1494 | NULL); |
1510 | NULL); |
1495 | } |
1511 | } |
1496 | |
1512 | |
1497 | Input_Context = XCreateIC (xim, |
1513 | Input_Context = XCreateIC (xim, |
1498 | XNInputStyle, input_style, |
1514 | XNInputStyle, input_style, |