… | |
… | |
530 | * Catch a fatal signal and tidy up before quitting |
530 | * Catch a fatal signal and tidy up before quitting |
531 | */ |
531 | */ |
532 | void |
532 | void |
533 | sig_term (sig_watcher &w) |
533 | sig_term (sig_watcher &w) |
534 | { |
534 | { |
535 | #ifdef DEBUG_CMD |
|
|
536 | rxvt_warn ("caught signal %d, exiting.\n", w.signum); |
|
|
537 | #endif |
|
|
538 | rxvt_emergency_cleanup (); |
535 | rxvt_emergency_cleanup (); |
539 | signal (w.signum, SIG_DFL); |
536 | signal (w.signum, SIG_DFL); |
540 | kill (getpid (), w.signum); |
537 | kill (getpid (), w.signum); |
541 | } |
538 | } |
542 | |
539 | |
… | |
… | |
620 | int x, y, sb_w, flags; |
617 | int x, y, sb_w, flags; |
621 | unsigned int w, h; |
618 | unsigned int w, h; |
622 | unsigned int max_width, max_height; |
619 | unsigned int max_width, max_height; |
623 | dDisp; |
620 | dDisp; |
624 | |
621 | |
625 | D_SIZE ((stderr, "< Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d", |
|
|
626 | ncol, nrow, szHint.width, szHint.height)); |
|
|
627 | |
|
|
628 | szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; |
622 | szHint.flags = PMinSize | PResizeInc | PBaseSize | PWinGravity; |
629 | szHint.win_gravity = NorthWestGravity; |
623 | szHint.win_gravity = NorthWestGravity; |
630 | /* szHint.min_aspect.x = szHint.min_aspect.y = 1; */ |
624 | /* szHint.min_aspect.x = szHint.min_aspect.y = 1; */ |
631 | |
625 | |
632 | recalc_x = recalc_y = 0; |
626 | recalc_x = recalc_y = 0; |
… | |
… | |
734 | if (recalc_y) |
728 | if (recalc_y) |
735 | szHint.y += DisplayHeight (disp, display->screen) - szHint.height - 2 * ext_bwidth; |
729 | szHint.y += DisplayHeight (disp, display->screen) - szHint.height - 2 * ext_bwidth; |
736 | |
730 | |
737 | ncol = width / fwidth; |
731 | ncol = width / fwidth; |
738 | nrow = height / fheight; |
732 | nrow = height / fheight; |
739 | D_SIZE ((stderr, "> Cols/Rows: %3d x %3d ; Width/Height: %4d x %4d", |
|
|
740 | ncol, nrow, szHint.width, |
|
|
741 | szHint.height)); |
|
|
742 | return; |
|
|
743 | } |
733 | } |
744 | |
734 | |
745 | /*----------------------------------------------------------------------*/ |
735 | /*----------------------------------------------------------------------*/ |
746 | /* |
736 | /* |
747 | * Tell the teletype handler what size the window is. |
737 | * Tell the teletype handler what size the window is. |
… | |
… | |
1273 | set_environ (envv); |
1263 | set_environ (envv); |
1274 | |
1264 | |
1275 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1265 | if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) |
1276 | return false; |
1266 | return false; |
1277 | |
1267 | |
1278 | D_MAIN ((stderr, "rxvt_IM_get_IC ()")); |
|
|
1279 | input_method = display->get_xim (locale, modifiers); |
1268 | input_method = display->get_xim (locale, modifiers); |
1280 | if (input_method == NULL) |
1269 | if (input_method == NULL) |
1281 | return false; |
1270 | return false; |
1282 | |
1271 | |
1283 | xim = input_method->xim; |
1272 | xim = input_method->xim; |
… | |
… | |
1429 | rxvt_warn ("failed to create input context, continuing without XIM.\n"); |
1418 | rxvt_warn ("failed to create input context, continuing without XIM.\n"); |
1430 | im_destroy (); |
1419 | im_destroy (); |
1431 | return false; |
1420 | return false; |
1432 | } |
1421 | } |
1433 | |
1422 | |
|
|
1423 | if (!XGetICValues (Input_Context, XNFilterEvents, &vt_emask_xim, NULL)) |
|
|
1424 | vt_select_input (); |
|
|
1425 | |
1434 | if (input_style & XIMPreeditArea) |
1426 | if (input_style & XIMPreeditArea) |
1435 | IMSetStatusPosition (); |
1427 | IMSetStatusPosition (); |
1436 | |
1428 | |
1437 | D_MAIN ((stderr, "rxvt_IM_get_IC () - successful connection")); |
|
|
1438 | return true; |
1429 | return true; |
1439 | } |
1430 | } |
1440 | |
1431 | |
1441 | void |
1432 | void |
1442 | rxvt_term::im_cb () |
1433 | rxvt_term::im_cb () |
… | |
… | |
1448 | |
1439 | |
1449 | make_current (); |
1440 | make_current (); |
1450 | |
1441 | |
1451 | im_destroy (); |
1442 | im_destroy (); |
1452 | |
1443 | |
1453 | D_MAIN ((stderr, "rxvt_IMInstantiateCallback ()")); |
|
|
1454 | if (Input_Context) |
1444 | if (Input_Context) |
1455 | return; |
1445 | return; |
1456 | |
1446 | |
1457 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1447 | #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) |
1458 | if (rs[Rs_imLocale]) |
1448 | if (rs[Rs_imLocale]) |