… | |
… | |
50 | #include "rxvtperl.h" |
50 | #include "rxvtperl.h" |
51 | #include "version.h" |
51 | #include "version.h" |
52 | #include "command.h" |
52 | #include "command.h" |
53 | |
53 | |
54 | #if HAVE_SCHED_YIELD |
54 | #if HAVE_SCHED_YIELD |
|
|
55 | #undef HAVE_SCHED_YIELD // disabled for the time being |
55 | # include <sched.h> |
56 | //# include <sched.h> |
56 | #endif |
57 | #endif |
57 | |
58 | |
58 | #ifdef KEYSYM_RESOURCE |
59 | #ifdef KEYSYM_RESOURCE |
59 | # include "keyboard.h" |
60 | # include "keyboard.h" |
60 | #endif |
61 | #endif |
… | |
… | |
1095 | { |
1096 | { |
1096 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1097 | ssize_t n = cmdbuf_endp - cmdbuf_ptr; |
1097 | |
1098 | |
1098 | if (CBUFSIZ == n) |
1099 | if (CBUFSIZ == n) |
1099 | { |
1100 | { |
1100 | rxvt_warn ("pty_fill on full buffer, draining input, continuing.\n"); |
1101 | rxvt_warn ("PLEASE REPORT: pty_fill on full buffer, draining input, continuing.\n"); |
1101 | n = 0; |
1102 | n = 0; |
1102 | } |
1103 | } |
1103 | |
1104 | |
1104 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1105 | memmove (cmdbuf_base, cmdbuf_ptr, n); |
1105 | cmdbuf_ptr = cmdbuf_base; |
1106 | cmdbuf_ptr = cmdbuf_base; |
… | |
… | |
1795 | rxvt_term::button_press (XButtonEvent &ev) |
1796 | rxvt_term::button_press (XButtonEvent &ev) |
1796 | { |
1797 | { |
1797 | int reportmode = 0, clickintime; |
1798 | int reportmode = 0, clickintime; |
1798 | |
1799 | |
1799 | bypass_keystate = ev.state & (ModMetaMask | ShiftMask); |
1800 | bypass_keystate = ev.state & (ModMetaMask | ShiftMask); |
|
|
1801 | |
1800 | if (!bypass_keystate) |
1802 | if (!bypass_keystate) |
1801 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
1803 | reportmode = !! (priv_modes & PrivMode_mouse_report); |
1802 | |
1804 | |
1803 | /* |
1805 | /* |
1804 | * VT window processing of button press |
1806 | * VT window processing of button press |
… | |
… | |
1853 | else |
1855 | else |
1854 | { |
1856 | { |
1855 | if (ev.button != MEvent.button) |
1857 | if (ev.button != MEvent.button) |
1856 | MEvent.clicks = 0; |
1858 | MEvent.clicks = 0; |
1857 | |
1859 | |
|
|
1860 | if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) |
1858 | switch (ev.button) |
1861 | switch (ev.button) |
1859 | { |
1862 | { |
1860 | case Button1: |
1863 | case Button1: |
1861 | /* allow meta + click to select rectangular areas */ |
1864 | /* allow meta + click to select rectangular areas */ |
1862 | /* should be done in screen.C */ |
1865 | /* should be done in screen.C */ |
1863 | #if ENABLE_FRILLS |
1866 | #if ENABLE_FRILLS |
1864 | selection.rect = !!(ev.state & ModMetaMask); |
1867 | selection.rect = !!(ev.state & ModMetaMask); |
1865 | #else |
1868 | #else |
1866 | selection.rect = false; |
1869 | selection.rect = false; |
1867 | #endif |
1870 | #endif |
1868 | |
1871 | |
1869 | /* allow shift+left click to extend selection */ |
1872 | /* allow shift+left click to extend selection */ |
1870 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1873 | if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) |
1871 | { |
1874 | { |
1872 | if (MEvent.button == Button1 && clickintime) |
1875 | if (MEvent.button == Button1 && clickintime) |
1873 | selection_rotate (ev.x, ev.y); |
1876 | selection_rotate (ev.x, ev.y); |
1874 | else |
1877 | else |
1875 | selection_extend (ev.x, ev.y, 1); |
1878 | selection_extend (ev.x, ev.y, 1); |
1876 | } |
1879 | } |
1877 | else |
1880 | else |
1878 | { |
1881 | { |
1879 | if (MEvent.button == Button1 && clickintime) |
1882 | if (MEvent.button == Button1 && clickintime) |
1880 | MEvent.clicks++; |
1883 | MEvent.clicks++; |
1881 | else |
1884 | else |
1882 | MEvent.clicks = 1; |
1885 | MEvent.clicks = 1; |
1883 | |
1886 | |
1884 | selection_click (MEvent.clicks, ev.x, ev.y); |
1887 | selection_click (MEvent.clicks, ev.x, ev.y); |
1885 | } |
1888 | } |
1886 | |
1889 | |
1887 | MEvent.button = Button1; |
1890 | MEvent.button = Button1; |
1888 | break; |
1891 | break; |
1889 | |
1892 | |
1890 | case Button3: |
1893 | case Button3: |
1891 | if (MEvent.button == Button3 && clickintime) |
1894 | if (MEvent.button == Button3 && clickintime) |
1892 | selection_rotate (ev.x, ev.y); |
1895 | selection_rotate (ev.x, ev.y); |
1893 | else |
1896 | else |
1894 | selection_extend (ev.x, ev.y, 1); |
1897 | selection_extend (ev.x, ev.y, 1); |
1895 | |
1898 | |
1896 | MEvent.button = Button3; |
1899 | MEvent.button = Button3; |
1897 | break; |
1900 | break; |
1898 | } |
1901 | } |
1899 | } |
1902 | } |
1900 | |
1903 | |
1901 | MEvent.time = ev.time; |
1904 | MEvent.time = ev.time; |
1902 | return; |
1905 | return; |
1903 | } |
1906 | } |
1904 | |
1907 | |
… | |
… | |
3959 | } |
3962 | } |
3960 | break; |
3963 | break; |
3961 | |
3964 | |
3962 | case URxvt_view_up: |
3965 | case URxvt_view_up: |
3963 | case URxvt_view_down: |
3966 | case URxvt_view_down: |
|
|
3967 | { |
3964 | int lines = atoi (str); |
3968 | int lines = atoi (str); |
3965 | |
3969 | |
3966 | if (lines) |
3970 | if (lines) |
3967 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3971 | scr_page (op == URxvt_view_up ? UP : DN, lines); |
3968 | else |
3972 | else |
3969 | { |
|
|
3970 | scr_erase_savelines (); |
3973 | scr_erase_savelines (); |
3971 | } |
3974 | } |
3972 | |
3975 | |
|
|
3976 | break; |
|
|
3977 | #endif |
|
|
3978 | |
|
|
3979 | #if ENABLE_PERL |
|
|
3980 | case URxvt_perl: |
|
|
3981 | if (PERL_INVOKE ((this, HOOK_OSC_SEQ, DT_STRING, str, DT_END))) |
|
|
3982 | ; // no responses yet |
3973 | break; |
3983 | break; |
3974 | #endif |
3984 | #endif |
3975 | } |
3985 | } |
3976 | } |
3986 | } |
3977 | /*----------------------------------------------------------------------*/ |
3987 | /*----------------------------------------------------------------------*/ |