ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/command.C
(Generate patch)

Comparing rxvt-unicode/src/command.C (file contents):
Revision 1.194 by root, Mon Feb 14 10:44:50 2005 UTC vs.
Revision 1.199 by root, Sun Feb 20 02:00:43 2005 UTC

25 * - extensive modifications 25 * - extensive modifications
26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org> 26 * Copyright (c) 1998 Alfredo K. Kojima <kojima@windowmaker.org>
27 * Copyright (c) 2001 Marius Gedminas 27 * Copyright (c) 2001 Marius Gedminas
28 * - Ctrl/Mod4+Tab works like Meta+Tab (options) 28 * - Ctrl/Mod4+Tab works like Meta+Tab (options)
29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org> 29 * Copyright (c) 2003 Rob McMullen <robm@flipturn.org>
30 * Copyright (c) 2003-2004 Marc Lehmann <pcg@goof.com> 30 * Copyright (c) 2003-2005 Marc Lehmann <pcg@goof.com>
31 * 31 *
32 * This program is free software; you can redistribute it and/or modify 32 * This program is free software; you can redistribute it and/or modify
33 * it under the terms of the GNU General Public License as published by 33 * it under the terms of the GNU General Public License as published by
34 * the Free Software Foundation; either version 2 of the License, or 34 * the Free Software Foundation; either version 2 of the License, or
35 * (at your option) any later version. 35 * (at your option) any later version.
117 XK_Escape, 0x238b, 117 XK_Escape, 0x238b,
118 XK_Undo, 0x238c, 118 XK_Undo, 0x238c,
119 XK_Print, 0x2399, 119 XK_Print, 0x2399,
120 120
121 XK_space, 0x2423, 121 XK_space, 0x2423,
122
123#ifdef XK_KP_Begin
124 XK_KP_Prior, 0x21de,
125 XK_KP_Next, 0x21df,
126 XK_KP_Begin, 0x2320,
127 XK_KP_Insert, 0x2380,
128 XK_KP_Delete, 0x2326,
122 XK_KP_Space, 0x2422, 129 XK_KP_Space, 0x2422,
130#endif
123 0, 131 0,
124}; 132};
125 133
126void 134void
127rxvt_term::iso14755_54 (int x, int y) 135rxvt_term::iso14755_54 (int x, int y)
276 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an 284 * use Num_Lock to toggle Keypad on/off. If Num_Lock is off, allow an
277 * escape sequence to toggle the Keypad. 285 * escape sequence to toggle the Keypad.
278 * 286 *
279 * Always permit `shift' to override the current setting 287 * Always permit `shift' to override the current setting
280 */ 288 */
281 shft = (ev.state & ShiftMask); 289 shft = ev.state & ShiftMask;
282 ctrl = (ev.state & ControlMask); 290 ctrl = ev.state & ControlMask;
283 meta = (ev.state & ModMetaMask); 291 meta = ev.state & ModMetaMask;
284 292
285 if (numlock_state || (ev.state & ModNumLockMask)) 293 if (numlock_state || (ev.state & ModNumLockMask))
286 { 294 {
287 numlock_state = (ev.state & ModNumLockMask); 295 numlock_state = (ev.state & ModNumLockMask);
288 PrivMode ((!numlock_state), PrivMode_aplKP); 296 PrivMode ((!numlock_state), PrivMode_aplKP);
512 else 520 else
513 strcpy (kbuf, key_backspace); 521 strcpy (kbuf, key_backspace);
514 break; 522 break;
515#endif 523#endif
516#ifndef NO_DELETE_KEY 524#ifndef NO_DELETE_KEY
525# ifdef XK_KP_Prior
526 case XK_KP_Delete:
527 /* allow shift to override */
528 if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
529 {
530 strcpy (kbuf, "\033On");
531 break;
532 }
533 /* FALLTHROUGH */
534# endif
517 case XK_Delete: 535 case XK_Delete:
518 strcpy (kbuf, key_delete); 536 strcpy (kbuf, key_delete);
519 break; 537 break;
520#endif 538#endif
521 case XK_Tab: 539 case XK_Tab:
624#ifdef XK_KP_Begin 642#ifdef XK_KP_Begin
625 case XK_KP_Begin: 643 case XK_KP_Begin:
626 strcpy (kbuf, "\033Ou"); 644 strcpy (kbuf, "\033Ou");
627 break; 645 break;
628 646
629 case XK_KP_Insert:
630 strcpy (kbuf, "\033Op");
631 break;
632
633 case XK_KP_Delete:
634 strcpy (kbuf, "\033On");
635 break;
636#endif 647#endif
637 case XK_KP_F1: /* "\033OP" */ 648 case XK_KP_F1: /* "\033OP" */
638 case XK_KP_F2: /* "\033OQ" */ 649 case XK_KP_F2: /* "\033OQ" */
639 case XK_KP_F3: /* "\033OR" */ 650 case XK_KP_F3: /* "\033OR" */
640 case XK_KP_F4: /* "\033OS" */ 651 case XK_KP_F4: /* "\033OS" */
672 break; 683 break;
673 684
674 case XK_Find: 685 case XK_Find:
675 strcpy (kbuf, "\033[1~"); 686 strcpy (kbuf, "\033[1~");
676 break; 687 break;
688
689#ifdef XK_KP_End
690 case XK_KP_Insert:
691 /* allow shift to override */
692 if ((priv_modes & PrivMode_aplKP) ? !shft : shft)
693 {
694 strcpy (kbuf, "\033Op");
695 break;
696 }
697 /* FALLTHROUGH */
698#endif
677 case XK_Insert: 699 case XK_Insert:
678 strcpy (kbuf, "\033[2~"); 700 strcpy (kbuf, "\033[2~");
679 break; 701 break;
680#ifdef DXK_Remove /* support for DEC remove like key */ 702#ifdef DXK_Remove /* support for DEC remove like key */
681 case DXK_Remove: 703 case DXK_Remove:
1308 button_release (ev.xbutton); 1330 button_release (ev.xbutton);
1309 break; 1331 break;
1310 1332
1311 case ClientMessage: 1333 case ClientMessage:
1312 if (ev.xclient.format == 32 1334 if (ev.xclient.format == 32
1335 && ev.xclient.message_type == xa[XA_WM_PROTOCOLS]
1313 && (Atom)ev.xclient.data.l[0] == xa[XA_WMDELETEWINDOW]) 1336 && ev.xclient.data.l[0] == xa[XA_WM_DELETE_WINDOW])
1314 destroy (); 1337 destroy ();
1338#if ENABLE_XEMBED
1339 else if (ev.xclient.format == 32
1340 && ev.xclient.message_type == xa[XA_XEMBED])
1341 {
1342 if (ev.xclient.data.l[1] == XEMBED_FOCUS_IN)
1343 focus_in ();
1344 else if (ev.xclient.data.l[1] == XEMBED_FOCUS_OUT)
1345 focus_out ();
1346 }
1347#endif
1315#ifdef OFFIX_DND 1348#ifdef OFFIX_DND
1316 /* OffiX Dnd (drag 'n' drop) protocol */ 1349 /* OffiX Dnd (drag 'n' drop) protocol */
1317 else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL] 1350 else if (ev.xclient.message_type == xa[XA_DNDPROTOCOL]
1318 && (ev.xclient.data.l[0] == DndFile 1351 && (ev.xclient.data.l[0] == DndFile
1319 || ev.xclient.data.l[0] == DndDir 1352 || ev.xclient.data.l[0] == DndDir
1320 || ev.xclient.data.l[0] == DndLink)) 1353 || ev.xclient.data.l[0] == DndLink))
1321 { 1354 {
1322 /* Get Dnd data */ 1355 /* Get Dnd data */
1323 Atom ActualType; 1356 Atom ActualType;
1324 int ActualFormat; 1357 int ActualFormat;
1325 unsigned char *data; 1358 unsigned char *data;
1368 break; 1401 break;
1369 } 1402 }
1370 break; 1403 break;
1371 1404
1372 case FocusIn: 1405 case FocusIn:
1373 if (!TermWin.focus) 1406 focus_in ();
1374 {
1375 TermWin.focus = 1;
1376 want_refresh = 1;
1377#ifdef USE_XIM
1378 if (Input_Context != NULL)
1379 {
1380 IMSetStatusPosition ();
1381 XSetICFocus (Input_Context);
1382 }
1383#endif
1384#ifdef CURSOR_BLINK
1385 if (options & Opt_cursorBlink)
1386 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1387#endif
1388#ifdef OFF_FOCUS_FADING
1389 if (rs[Rs_fade])
1390 {
1391 pix_colors = pix_colors_focused;
1392 scr_recolour ();
1393 }
1394#endif
1395
1396 }
1397 break; 1407 break;
1398 1408
1399 case FocusOut: 1409 case FocusOut:
1400 if (TermWin.focus) 1410 focus_out ();
1401 {
1402 TermWin.focus = 0;
1403 want_refresh = 1;
1404
1405#if ENABLE_FRILLS || ISO_14755
1406 iso14755buf = 0;
1407#endif
1408#if ENABLE_OVERLAY
1409 scr_overlay_off ();
1410#endif
1411#ifdef USE_XIM
1412 if (Input_Context != NULL)
1413 XUnsetICFocus (Input_Context);
1414#endif
1415#ifdef CURSOR_BLINK
1416 if (options & Opt_cursorBlink)
1417 cursor_blink_ev.stop ();
1418 hidden_cursor = 0;
1419#endif
1420#ifdef OFF_FOCUS_FADING
1421 if (rs[Rs_fade])
1422 {
1423 pix_colors = pix_colors_unfocused;
1424 scr_recolour ();
1425 }
1426#endif
1427 }
1428 break; 1411 break;
1429 1412
1430 case ConfigureNotify: 1413 case ConfigureNotify:
1431 if (ev.xconfigure.window == TermWin.parent[0]) 1414 if (ev.xconfigure.window == TermWin.parent[0])
1432 { 1415 {
1646 scr_refresh (refresh_type); 1629 scr_refresh (refresh_type);
1647 refresh_limit = 0; 1630 refresh_limit = 0;
1648 scrollbar_show (1); 1631 scrollbar_show (1);
1649 } 1632 }
1650 break; 1633 break;
1634 }
1635}
1636
1637void
1638rxvt_term::focus_in ()
1639{
1640 if (!TermWin.focus)
1641 {
1642 TermWin.focus = 1;
1643 want_refresh = 1;
1644#ifdef USE_XIM
1645 if (Input_Context != NULL)
1646 {
1647 IMSetStatusPosition ();
1648 XSetICFocus (Input_Context);
1649 }
1650#endif
1651#ifdef CURSOR_BLINK
1652 if (options & Opt_cursorBlink)
1653 cursor_blink_ev.start (NOW + BLINK_INTERVAL);
1654#endif
1655#ifdef OFF_FOCUS_FADING
1656 if (rs[Rs_fade])
1657 {
1658 pix_colors = pix_colors_focused;
1659 scr_recolour ();
1660 }
1661#endif
1662 }
1663}
1664
1665void
1666rxvt_term::focus_out ()
1667{
1668 if (TermWin.focus)
1669 {
1670 TermWin.focus = 0;
1671 want_refresh = 1;
1672
1673#if ENABLE_FRILLS || ISO_14755
1674 iso14755buf = 0;
1675#endif
1676#if ENABLE_OVERLAY
1677 scr_overlay_off ();
1678#endif
1679#ifdef USE_XIM
1680 if (Input_Context != NULL)
1681 XUnsetICFocus (Input_Context);
1682#endif
1683#ifdef CURSOR_BLINK
1684 if (options & Opt_cursorBlink)
1685 cursor_blink_ev.stop ();
1686 hidden_cursor = 0;
1687#endif
1688#ifdef OFF_FOCUS_FADING
1689 if (rs[Rs_fade])
1690 {
1691 pix_colors = pix_colors_unfocused;
1692 scr_recolour ();
1693 }
1694#endif
1651 } 1695 }
1652} 1696}
1653 1697
1654#if TRANSPARENT 1698#if TRANSPARENT
1655void 1699void
2580 // some window managers resize the window early, and these programs 2624 // some window managers resize the window early, and these programs
2581 // then sometimes get the size wrong. 2625 // then sometimes get the size wrong.
2582 // unfortunately other programs are even more buggy and dislike 2626 // unfortunately other programs are even more buggy and dislike
2583 // being sent SIGWINCH, so only do it when we were in fact being 2627 // being sent SIGWINCH, so only do it when we were in fact being
2584 // resized. 2628 // resized.
2585 if (seen_resize) 2629 if (seen_resize && cmd_pid)
2586 kill (-cmd_pid, SIGWINCH); 2630 kill (-cmd_pid, SIGWINCH);
2587 } 2631 }
2588 2632
2589 /* Read a text string from the input buffer */ 2633 /* Read a text string from the input buffer */
2590 unicode_t buf[UBUFSIZ]; 2634 unicode_t buf[UBUFSIZ];
3832 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp); 3876 tt_printf ("\33]%d;%-.250s%c", XTerm_locale, (options & Opt_insecure) ? locale : "", resp);
3833 else 3877 else
3834 { 3878 {
3835 set_locale (str); 3879 set_locale (str);
3836 pty.set_utf8_mode (enc_utf8); 3880 pty.set_utf8_mode (enc_utf8);
3837# ifdef USE_XIM
3838 im_cb (); 3881 init_xlocale ();
3839# endif
3840 } 3882 }
3841 break; 3883 break;
3842#endif 3884#endif
3843 3885
3844#ifdef MENUBAR 3886#ifdef MENUBAR

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines