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.318 by root, Sat Jan 13 15:26:56 2007 UTC vs.
Revision 1.323 by ayin, Mon May 28 18:38:03 2007 UTC

497 { 497 {
498 commit_iso14755 (); 498 commit_iso14755 ();
499 iso14755buf = ISO_14755_51; 499 iso14755buf = ISO_14755_51;
500# if ISO_14755 500# if ISO_14755
501 iso14755_51 (0); 501 iso14755_51 (0);
502# endif
503 return;
504 }
505 else if (keysym == XK_BackSpace)
506 {
507 iso14755buf = ((iso14755buf & ISO_14755_MASK) >> 4) | ISO_14755_51;
508# if ISO_14755
509 iso14755_51 (iso14755buf & ISO_14755_MASK);
502# endif 510# endif
503 return; 511 return;
504 } 512 }
505 else if ((hv = hex_keyval (ev)) >= 0) 513 else if ((hv = hex_keyval (ev)) >= 0)
506 { 514 {
877 return; 885 return;
878 886
879 if (len <= 0) 887 if (len <= 0)
880 return; /* not mapped */ 888 return; /* not mapped */
881 889
882 if (OPTION (Opt_scrollTtyKeypress)) 890 if (option (Opt_scrollTtyKeypress))
883 if (view_start) 891 if (view_start)
884 { 892 {
885 view_start = 0; 893 view_start = 0;
886 want_refresh = 1; 894 want_refresh = 1;
887 } 895 }
1232 } 1240 }
1233 else 1241 else
1234 { 1242 {
1235 pty_ev.stop (); 1243 pty_ev.stop ();
1236 1244
1237 if (!OPTION (Opt_hold)) 1245 if (!option (Opt_hold))
1238 destroy (); 1246 destroy ();
1239 } 1247 }
1240 1248
1241 return false; 1249 return false;
1242} 1250}
1263 recolour_cursor (); 1271 recolour_cursor ();
1264 1272
1265#ifdef POINTER_BLANK 1273#ifdef POINTER_BLANK
1266 hidden_pointer = 0; 1274 hidden_pointer = 0;
1267 1275
1268 if (OPTION (Opt_pointerBlank)) 1276 if (option (Opt_pointerBlank))
1269 pointer_ev.start (NOW + pointerBlankDelay); 1277 pointer_ev.start (NOW + pointerBlankDelay);
1270#endif 1278#endif
1271} 1279}
1272 1280
1273#ifdef POINTER_BLANK 1281#ifdef POINTER_BLANK
1274void 1282void
1275rxvt_term::pointer_blank () 1283rxvt_term::pointer_blank ()
1276{ 1284{
1277 if (!OPTION (Opt_pointerBlank)) 1285 if (!option (Opt_pointerBlank))
1278 return; 1286 return;
1279 1287
1280 XDefineCursor (dpy, vt, display->blank_cursor); 1288 XDefineCursor (dpy, vt, display->blank_cursor);
1281 XFlush (dpy); 1289 XFlush (dpy);
1282 1290
1458 break; 1466 break;
1459 } 1467 }
1460 break; 1468 break;
1461 1469
1462 case FocusIn: 1470 case FocusIn:
1463 if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) 1471 if (ev.xfocus.detail != NotifyInferior
1472 && ev.xfocus.detail != NotifyPointer
1473 && ev.xfocus.mode != NotifyGrab)
1464 focus_in (); 1474 focus_in ();
1465 break; 1475 break;
1466 1476
1467 case FocusOut: 1477 case FocusOut:
1468 if (ev.xfocus.detail != NotifyInferior && ev.xfocus.detail != NotifyPointer) 1478 if (ev.xfocus.detail != NotifyInferior
1479 && ev.xfocus.detail != NotifyPointer
1480 && ev.xfocus.mode != NotifyGrab)
1469 focus_out (); 1481 focus_out ();
1470 break; 1482 break;
1471 1483
1472 case ConfigureNotify: 1484 case ConfigureNotify:
1473 if (ev.xconfigure.window == parent[0]) 1485 if (ev.xconfigure.window == parent[0])
1482 } 1494 }
1483 1495
1484 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END)); 1496 HOOK_INVOKE ((this, HOOK_CONFIGURE_NOTIFY, DT_XEVENT, &ev, DT_END));
1485 1497
1486#ifdef TRANSPARENT 1498#ifdef TRANSPARENT
1487 if (OPTION (Opt_transparent)) 1499 if (option (Opt_transparent))
1488 check_our_parents (); 1500 check_our_parents ();
1489#endif 1501#endif
1490 } 1502 }
1491 break; 1503 break;
1492 1504
1681 } 1693 }
1682 break; 1694 break;
1683 } 1695 }
1684 1696
1685#if defined(CURSOR_BLINK) 1697#if defined(CURSOR_BLINK)
1686 if (OPTION (Opt_cursorBlink) && ev.type == KeyPress) 1698 if (option (Opt_cursorBlink) && ev.type == KeyPress)
1687 { 1699 {
1688 if (hidden_cursor) 1700 if (hidden_cursor)
1689 { 1701 {
1690 hidden_cursor = 0; 1702 hidden_cursor = 0;
1691 want_refresh = 1; 1703 want_refresh = 1;
1694 cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); 1706 cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL);
1695 } 1707 }
1696#endif 1708#endif
1697 1709
1698#if defined(POINTER_BLANK) 1710#if defined(POINTER_BLANK)
1699 if (OPTION (Opt_pointerBlank) && pointerBlankDelay > 0) 1711 if (option (Opt_pointerBlank) && pointerBlankDelay > 0)
1700 { 1712 {
1701 if (ev.type == MotionNotify 1713 if (ev.type == MotionNotify
1702 || ev.type == ButtonPress 1714 || ev.type == ButtonPress
1703 || ev.type == ButtonRelease) 1715 || ev.type == ButtonRelease)
1704 if (hidden_pointer) 1716 if (hidden_pointer)
1726 IMSetPosition (); 1738 IMSetPosition ();
1727 XSetICFocus (Input_Context); 1739 XSetICFocus (Input_Context);
1728 } 1740 }
1729#endif 1741#endif
1730#if CURSOR_BLINK 1742#if CURSOR_BLINK
1731 if (OPTION (Opt_cursorBlink)) 1743 if (option (Opt_cursorBlink))
1732 cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL); 1744 cursor_blink_ev.start (NOW + CURSOR_BLINK_INTERVAL);
1733#endif 1745#endif
1734#if OFF_FOCUS_FADING 1746#if OFF_FOCUS_FADING
1735 if (rs[Rs_fade]) 1747 if (rs[Rs_fade])
1736 { 1748 {
1737 pix_colors = pix_colors_focused; 1749 pix_colors = pix_colors_focused;
1738 scr_recolour (); 1750 scr_recolour ();
1751 }
1752#endif
1753#if ENABLE_FRILLS
1754 if (option (Opt_urgentOnBell))
1755 {
1756 XWMHints *h;
1757
1758 h = XGetWMHints(dpy, parent[0]);
1759 if (h != NULL)
1760 {
1761 h->flags &= ~XUrgencyHint;
1762 XSetWMHints(dpy, parent[0], h);
1763 }
1739 } 1764 }
1740#endif 1765#endif
1741 } 1766 }
1742} 1767}
1743 1768
1763#if USE_XIM 1788#if USE_XIM
1764 if (Input_Context != NULL) 1789 if (Input_Context != NULL)
1765 XUnsetICFocus (Input_Context); 1790 XUnsetICFocus (Input_Context);
1766#endif 1791#endif
1767#if CURSOR_BLINK 1792#if CURSOR_BLINK
1768 if (OPTION (Opt_cursorBlink)) 1793 if (option (Opt_cursorBlink))
1769 cursor_blink_ev.stop (); 1794 cursor_blink_ev.stop ();
1770 hidden_cursor = 0; 1795 hidden_cursor = 0;
1771#endif 1796#endif
1772#if OFF_FOCUS_FADING 1797#if OFF_FOCUS_FADING
1773 if (rs[Rs_fade]) 1798 if (rs[Rs_fade])
1814 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID]) 1839 && ev.xproperty.atom != xa[XA_ESETROOT_PMAP_ID])
1815 return; 1840 return;
1816 1841
1817 /* FALLTHROUGH */ 1842 /* FALLTHROUGH */
1818 case ReparentNotify: 1843 case ReparentNotify:
1819 if (OPTION (Opt_transparent) && check_our_parents () && am_transparent) 1844 if (option (Opt_transparent) && check_our_parents () && am_transparent)
1820 want_refresh = want_full_refresh = 1; 1845 want_refresh = want_full_refresh = 1;
1821 break; 1846 break;
1822 } 1847 }
1823# endif 1848# endif
1824} 1849}
2156 selection_make (ev.time); 2181 selection_make (ev.time);
2157 break; 2182 break;
2158 2183
2159 case Button2: 2184 case Button2:
2160 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? 2185 if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window?
2161 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); 2186 selection_request (ev.time, ev.state & ModMetaMask ? Sel_Clipboard : Sel_Primary);
2162 break; 2187 break;
2163 2188
2164#ifdef MOUSE_WHEEL 2189#ifdef MOUSE_WHEEL
2165 case Button4: 2190 case Button4:
2166 case Button5: 2191 case Button5:
2170 2195
2171 v = ev.button == Button4 ? UP : DN; 2196 v = ev.button == Button4 ? UP : DN;
2172 2197
2173 if (ev.state & ShiftMask) 2198 if (ev.state & ShiftMask)
2174 i = 1; 2199 i = 1;
2175 else if (OPTION (Opt_mouseWheelScrollPage)) 2200 else if (option (Opt_mouseWheelScrollPage))
2176 i = nrow - 1; 2201 i = nrow - 1;
2177 else 2202 else
2178 i = 5; 2203 i = 5;
2179 2204
2180# ifdef MOUSE_SLIP_WHEELING 2205# ifdef MOUSE_SLIP_WHEELING
2451 Pixmap rootpixmap = None; 2476 Pixmap rootpixmap = None;
2452 XWindowAttributes wattr, wrootattr; 2477 XWindowAttributes wattr, wrootattr;
2453 2478
2454 pchanged = 0; 2479 pchanged = 0;
2455 2480
2456 if (!OPTION (Opt_transparent)) 2481 if (!option (Opt_transparent))
2457 return pchanged; /* Don't try any more */ 2482 return pchanged; /* Don't try any more */
2458 2483
2459 XGetWindowAttributes (dpy, display->root, &wrootattr); 2484 XGetWindowAttributes (dpy, display->root, &wrootattr);
2460 rootdepth = wrootattr.depth; 2485 rootdepth = wrootattr.depth;
2461 2486
2731 if (ch == C0_LF) 2756 if (ch == C0_LF)
2732 nlines++; 2757 nlines++;
2733 2758
2734 refresh_count++; 2759 refresh_count++;
2735 2760
2736 if (!OPTION (Opt_jumpScroll) 2761 if (!option (Opt_jumpScroll)
2737 || (refresh_count >= refresh_limit * (nrow - 1))) 2762 || (refresh_count >= refresh_limit * (nrow - 1)))
2738 { 2763 {
2739 refreshnow = true; 2764 refreshnow = true;
2740 refresh_count = 0; 2765 refresh_count = 0;
2741 ch = NOCHAR; 2766 ch = NOCHAR;
2781 * the number of pages between refreshes is refresh_limit, which 2806 * the number of pages between refreshes is refresh_limit, which
2782 * is incremented here because we must be doing flat-out scrolling. 2807 * is incremented here because we must be doing flat-out scrolling.
2783 */ 2808 */
2784 if (refreshnow) 2809 if (refreshnow)
2785 { 2810 {
2786 if (OPTION (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD) 2811 if (option (Opt_jumpScroll) && refresh_limit < REFRESH_PERIOD)
2787 refresh_limit++; 2812 refresh_limit++;
2788 else 2813 else
2789 { 2814 {
2790 flag = true; 2815 flag = true;
2791 //TODO: due to popular request, implement "skipscroll" option here 2816 //TODO: due to popular request, implement "skipscroll" option here
3457 break; 3482 break;
3458 case 6: /* CPR requested */ 3483 case 6: /* CPR requested */
3459 scr_report_position (); 3484 scr_report_position ();
3460 break; 3485 break;
3461 case 7: /* unofficial extension */ 3486 case 7: /* unofficial extension */
3462 if (OPTION (Opt_insecure)) 3487 if (option (Opt_insecure))
3463 tt_printf ("%-.250s\012", rs[Rs_display_name]); 3488 tt_printf ("%-.250s\012", rs[Rs_display_name]);
3464 break; 3489 break;
3465 case 8: /* unofficial extension */ 3490 case 8: /* unofficial extension */
3466 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST); 3491 process_xterm_seq (XTerm_title, RESNAME "-" VERSION, CHAR_ST);
3467 break; 3492 break;
3631 break; 3656 break;
3632 case 20: /* report icon label */ 3657 case 20: /* report icon label */
3633 { 3658 {
3634 char *s; 3659 char *s;
3635 XGetIconName (dpy, parent[0], &s); 3660 XGetIconName (dpy, parent[0], &s);
3636 tt_printf ("\033]L%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ 3661 tt_printf ("\033]L%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */
3637 XFree (s); 3662 XFree (s);
3638 } 3663 }
3639 break; 3664 break;
3640 case 21: /* report window title */ 3665 case 21: /* report window title */
3641 { 3666 {
3642 char *s; 3667 char *s;
3643 XFetchName (dpy, parent[0], &s); 3668 XFetchName (dpy, parent[0], &s);
3644 tt_printf ("\033]l%-.250s\234", OPTION (Opt_insecure) && s ? s : ""); /* 8bit ST */ 3669 tt_printf ("\033]l%-.250s\234", option (Opt_insecure) && s ? s : ""); /* 8bit ST */
3645 XFree (s); 3670 XFree (s);
3646 } 3671 }
3647 break; 3672 break;
3648 } 3673 }
3649} 3674}
3957 case URxvt_italicFont: 3982 case URxvt_italicFont:
3958 case URxvt_boldItalicFont: 3983 case URxvt_boldItalicFont:
3959#endif 3984#endif
3960 if (query) 3985 if (query)
3961 tt_printf ("\33]%d;%-.250s%c", saveop, 3986 tt_printf ("\33]%d;%-.250s%c", saveop,
3962 OPTION (Opt_insecure) && fontset[op - URxvt_font]->fontdesc 3987 option (Opt_insecure) && fontset[op - URxvt_font]->fontdesc
3963 ? fontset[op - URxvt_font]->fontdesc : "", 3988 ? fontset[op - URxvt_font]->fontdesc : "",
3964 resp); 3989 resp);
3965 else 3990 else
3966 { 3991 {
3967 const char *&res = rs[Rs_font + (op - URxvt_font)]; 3992 const char *&res = rs[Rs_font + (op - URxvt_font)];
3981 break; 4006 break;
3982 4007
3983#if !ENABLE_MINIMAL 4008#if !ENABLE_MINIMAL
3984 case URxvt_locale: 4009 case URxvt_locale:
3985 if (query) 4010 if (query)
3986 tt_printf ("\33]%d;%-.250s%c", op, OPTION (Opt_insecure) ? locale : "", resp); 4011 tt_printf ("\33]%d;%-.250s%c", op, option (Opt_insecure) ? locale : "", resp);
3987 else 4012 else
3988 { 4013 {
3989 set_locale (str); 4014 set_locale (str);
3990 pty->set_utf8_mode (enc_utf8); 4015 pty->set_utf8_mode (enc_utf8);
3991 init_xlocale (); 4016 init_xlocale ();
4132 scr_touch (true); 4157 scr_touch (true);
4133 break; 4158 break;
4134#endif 4159#endif
4135 case 1048: /* alternative cursor save */ 4160 case 1048: /* alternative cursor save */
4136 case 1049: 4161 case 1049:
4137 if (OPTION (Opt_secondaryScreen)) 4162 if (option (Opt_secondaryScreen))
4138 if (mode == 0) 4163 if (mode == 0)
4139 scr_cursor (RESTORE); 4164 scr_cursor (RESTORE);
4140 else if (mode == 1) 4165 else if (mode == 1)
4141 scr_cursor (SAVE); 4166 scr_cursor (SAVE);
4142 break; 4167 break;
4207 break; 4232 break;
4208 case 1011: /* scroll to bottom on key press */ 4233 case 1011: /* scroll to bottom on key press */
4209 set_option (Opt_scrollTtyKeypress, state); 4234 set_option (Opt_scrollTtyKeypress, state);
4210 break; 4235 break;
4211 case 1047: /* secondary screen w/ clearing last */ 4236 case 1047: /* secondary screen w/ clearing last */
4212 if (OPTION (Opt_secondaryScreen)) 4237 if (option (Opt_secondaryScreen))
4213 if (current_screen != PRIMARY) 4238 if (current_screen != PRIMARY)
4214 scr_erase_screen (2); 4239 scr_erase_screen (2);
4215 scr_change_screen (state); 4240 scr_change_screen (state);
4216 break; 4241 break;
4217 case 1049: /* secondary screen w/ clearing first */ 4242 case 1049: /* secondary screen w/ clearing first */
4218 scr_change_screen (state); 4243 scr_change_screen (state);
4219 if (OPTION (Opt_secondaryScreen)) 4244 if (option (Opt_secondaryScreen))
4220 if (current_screen != PRIMARY) 4245 if (current_screen != PRIMARY)
4221 scr_erase_screen (2); 4246 scr_erase_screen (2);
4222 break; 4247 break;
4223 default: 4248 default:
4224 break; 4249 break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines