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.238 by root, Fri Jan 6 02:58:02 2006 UTC vs.
Revision 1.243 by root, Fri Jan 6 05:43:36 2006 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-2005 Marc Lehmann <pcg@goof.com> 30 * Copyright (c) 2003-2006 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.
867#endif 867#endif
868 /* nil */ ; 868 /* nil */ ;
869 } 869 }
870 } 870 }
871 871
872 if (HOOK_INVOKE ((this, HOOK_KEY_PRESS, DT_XEVENT, &ev, DT_STRING_LEN, kbuf, len, DT_END)))
873 return;
874
872 if (len <= 0) 875 if (len <= 0)
873 return; /* not mapped */ 876 return; /* not mapped */
874 877
875 if (OPTION (Opt_scrollTtyKeypress)) 878 if (OPTION (Opt_scrollTtyKeypress))
876 if (view_start) 879 if (view_start)
1202 1205
1203#ifdef POINTER_BLANK 1206#ifdef POINTER_BLANK
1204void 1207void
1205rxvt_term::pointer_blank () 1208rxvt_term::pointer_blank ()
1206{ 1209{
1207 if (! OPTION (Opt_pointerBlank)) 1210 if (!OPTION (Opt_pointerBlank))
1208 return; 1211 return;
1209 1212
1210 XDefineCursor (display->display, vt, display->blank_cursor); 1213 XDefineCursor (display->display, vt, display->blank_cursor);
1211 XFlush (display->display); 1214 XFlush (display->display);
1212 1215
1411# endif 1414# endif
1412 else 1415 else
1413 iso14755buf = 0; 1416 iso14755buf = 0;
1414 } 1417 }
1415#endif 1418#endif
1419
1420 if (ev.xany.window == vt && HOOK_INVOKE ((this, HOOK_KEY_RELEASE, DT_XEVENT, &ev, DT_END)))
1421 break;
1416 1422
1417#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING) 1423#if defined(MOUSE_WHEEL) && defined(MOUSE_SLIP_WHEELING)
1418 if (!(ev.xkey.state & ControlMask)) 1424 if (!(ev.xkey.state & ControlMask))
1419 slip_wheel_ev.stop (); 1425 slip_wheel_ev.stop ();
1420 else if (ks == XK_Control_L || ks == XK_Control_R) 1426 else if (ks == XK_Control_L || ks == XK_Control_R)
1635 if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate) 1641 if ((priv_modes & PrivMode_mouse_report) && !bypass_keystate)
1636 break; 1642 break;
1637 1643
1638 if (ev.xany.window == vt) 1644 if (ev.xany.window == vt)
1639 { 1645 {
1646 if (HOOK_INVOKE ((this, HOOK_MOTION_NOTIFY, DT_XEVENT, &ev, DT_END)))
1647 ; // nop
1640 if (ev.xbutton.state & (Button1Mask | Button3Mask)) 1648 else if (ev.xbutton.state & (Button1Mask | Button3Mask))
1641 { 1649 {
1642 while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev)) 1650 while (XCheckTypedWindowEvent (disp, vt, MotionNotify, &ev))
1643 ; 1651 ;
1644 1652
1645 XQueryPointer (disp, vt, 1653 XQueryPointer (disp, vt,
1865#ifdef MOUSE_REPORT_DOUBLECLICK 1873#ifdef MOUSE_REPORT_DOUBLECLICK
1866 if (ev.button == MEvent.button && clickintime) 1874 if (ev.button == MEvent.button && clickintime)
1867 { 1875 {
1868 /* same button, within alloted time */ 1876 /* same button, within alloted time */
1869 MEvent.clicks++; 1877 MEvent.clicks++;
1878
1870 if (MEvent.clicks > 1) 1879 if (MEvent.clicks > 1)
1871 { 1880 {
1872 /* only report double clicks */ 1881 /* only report double clicks */
1873 MEvent.clicks = 2; 1882 MEvent.clicks = 2;
1874 mouse_report (ev); 1883 mouse_report (ev);
1894 else 1903 else
1895 { 1904 {
1896 if (ev.button != MEvent.button) 1905 if (ev.button != MEvent.button)
1897 MEvent.clicks = 0; 1906 MEvent.clicks = 0;
1898 1907
1899 if (!HOOK_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) 1908 if (!HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END)))
1900 switch (ev.button) 1909 switch (ev.button)
1901 { 1910 {
1902 case Button1: 1911 case Button1:
1903 /* allow meta + click to select rectangular areas */ 1912 /* allow meta + click to select rectangular areas */
1904 /* should be done in screen.C */ 1913 /* should be done in screen.C */
2082 } 2091 }
2083 2092
2084 break; 2093 break;
2085 } 2094 }
2086 } 2095 }
2096
2087 return; 2097 return;
2088 } 2098 }
2099
2089#if MENUBAR 2100#if MENUBAR
2090 /* 2101 /*
2091 * Menubar window processing of button press 2102 * Menubar window processing of button press
2092 */ 2103 */
2093 if (isMenuBarWindow (ev.window)) 2104 if (isMenuBarWindow (ev.window))
2155 */ 2166 */
2156 if (priv_modes & PrivMode_mouse_report 2167 if (priv_modes & PrivMode_mouse_report
2157 && bypass_keystate 2168 && bypass_keystate
2158 && ev.button == Button1 && MEvent.clicks <= 1) 2169 && ev.button == Button1 && MEvent.clicks <= 1)
2159 selection_extend (ev.x, ev.y, 0); 2170 selection_extend (ev.x, ev.y, 0);
2171
2172 if (!HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END)))
2173 return;
2160 2174
2161 switch (ev.button) 2175 switch (ev.button)
2162 { 2176 {
2163 case Button1: 2177 case Button1:
2164 case Button3: 2178 case Button3:
4454const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT 4468const unsigned int MAX_PTY_WRITE = 255; // minimum MAX_INPUT
4455 4469
4456void 4470void
4457rxvt_term::tt_write (const char *data, unsigned int len) 4471rxvt_term::tt_write (const char *data, unsigned int len)
4458{ 4472{
4473 if (pty.pty < 0)
4474 return;
4475
4459 if (v_buflen == 0) 4476 if (v_buflen == 0)
4460 { 4477 {
4461 ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE)); 4478 ssize_t written = write (pty.pty, data, min (len, MAX_PTY_WRITE));
4462 4479
4463 if ((unsigned int)written == len) 4480 if ((unsigned int)written == len)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines