… | |
… | |
1823 | /* |
1823 | /* |
1824 | * VT window processing of button press |
1824 | * VT window processing of button press |
1825 | */ |
1825 | */ |
1826 | if (ev.window == vt) |
1826 | if (ev.window == vt) |
1827 | { |
1827 | { |
|
|
1828 | if (HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END))) |
|
|
1829 | return; |
|
|
1830 | |
1828 | #if ISO_14755 |
1831 | #if ISO_14755 |
1829 | // 5.4 |
1832 | // 5.4 |
1830 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
1833 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
1831 | { |
1834 | { |
1832 | iso14755_54 (ev.x, ev.y); |
1835 | iso14755_54 (ev.x, ev.y); |
… | |
… | |
1874 | else |
1877 | else |
1875 | { |
1878 | { |
1876 | if (ev.button != MEvent.button) |
1879 | if (ev.button != MEvent.button) |
1877 | MEvent.clicks = 0; |
1880 | MEvent.clicks = 0; |
1878 | |
1881 | |
1879 | if (!HOOK_INVOKE ((this, HOOK_BUTTON_PRESS, DT_XEVENT, &ev, DT_END))) |
|
|
1880 | switch (ev.button) |
1882 | switch (ev.button) |
1881 | { |
1883 | { |
1882 | case Button1: |
1884 | case Button1: |
1883 | /* allow meta + click to select rectangular areas */ |
1885 | /* allow meta + click to select rectangular areas */ |
1884 | /* should be done in screen.C */ |
1886 | /* should be done in screen.C */ |
1885 | #if ENABLE_FRILLS |
1887 | #if ENABLE_FRILLS |
1886 | selection.rect = !!(ev.state & ModMetaMask); |
1888 | selection.rect = !!(ev.state & ModMetaMask); |
1887 | #else |
1889 | #else |
1888 | selection.rect = false; |
1890 | selection.rect = false; |
1889 | #endif |
1891 | #endif |
1890 | |
1892 | |
1891 | /* allow shift+left click to extend selection */ |
1893 | /* allow shift+left click to extend selection */ |
1892 | if (ev.state & ShiftMask && !(priv_modes & PrivMode_mouse_report)) |
1894 | if (ev.state & ShiftMask && !(priv_modes & PrivMode_mouse_report)) |
1893 | { |
1895 | { |
1894 | if (MEvent.button == Button1 && clickintime) |
1896 | if (MEvent.button == Button1 && clickintime) |
1895 | selection_rotate (ev.x, ev.y); |
1897 | selection_rotate (ev.x, ev.y); |
1896 | else |
1898 | else |
1897 | selection_extend (ev.x, ev.y, 1); |
1899 | selection_extend (ev.x, ev.y, 1); |
1898 | } |
1900 | } |
1899 | else |
1901 | else |
1900 | { |
1902 | { |
1901 | if (MEvent.button == Button1 && clickintime) |
1903 | if (MEvent.button == Button1 && clickintime) |
1902 | MEvent.clicks++; |
1904 | MEvent.clicks++; |
1903 | else |
1905 | else |
1904 | MEvent.clicks = 1; |
1906 | MEvent.clicks = 1; |
1905 | |
1907 | |
1906 | selection_click (MEvent.clicks, ev.x, ev.y); |
1908 | selection_click (MEvent.clicks, ev.x, ev.y); |
1907 | } |
1909 | } |
1908 | |
1910 | |
1909 | MEvent.button = Button1; |
1911 | MEvent.button = Button1; |
1910 | break; |
1912 | break; |
1911 | |
1913 | |
1912 | case Button3: |
1914 | case Button3: |
1913 | if (MEvent.button == Button3 && clickintime) |
1915 | if (MEvent.button == Button3 && clickintime) |
1914 | selection_rotate (ev.x, ev.y); |
1916 | selection_rotate (ev.x, ev.y); |
1915 | else |
1917 | else |
1916 | selection_extend (ev.x, ev.y, 1); |
1918 | selection_extend (ev.x, ev.y, 1); |
1917 | |
1919 | |
1918 | MEvent.button = Button3; |
1920 | MEvent.button = Button3; |
1919 | break; |
1921 | break; |
1920 | } |
1922 | } |
1921 | } |
1923 | } |
1922 | |
1924 | |
1923 | MEvent.time = ev.time; |
1925 | MEvent.time = ev.time; |
1924 | return; |
1926 | return; |
1925 | } |
1927 | } |
1926 | |
1928 | |
… | |
… | |
2089 | sel_scroll_ev.stop(); |
2091 | sel_scroll_ev.stop(); |
2090 | #endif |
2092 | #endif |
2091 | |
2093 | |
2092 | if (ev.window == vt) |
2094 | if (ev.window == vt) |
2093 | { |
2095 | { |
|
|
2096 | if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
|
|
2097 | return; |
|
|
2098 | |
2094 | #if ISO_14755 |
2099 | #if ISO_14755 |
2095 | // 5.4 |
2100 | // 5.4 |
2096 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
2101 | if (iso14755buf & (ISO_14755_STARTED | ISO_14755_54)) |
2097 | return; |
2102 | return; |
2098 | #endif |
2103 | #endif |
|
|
2104 | |
2099 | if (reportmode) |
2105 | if (reportmode) |
2100 | { |
2106 | { |
2101 | /* mouse report from vt window */ |
2107 | /* mouse report from vt window */ |
2102 | /* don't report release of wheel "buttons" */ |
2108 | /* don't report release of wheel "buttons" */ |
2103 | if (ev.button >= 4) |
2109 | if (ev.button >= 4) |
… | |
… | |
2127 | if (priv_modes & PrivMode_mouse_report |
2133 | if (priv_modes & PrivMode_mouse_report |
2128 | && bypass_keystate |
2134 | && bypass_keystate |
2129 | && ev.button == Button1 && MEvent.clicks <= 1) |
2135 | && ev.button == Button1 && MEvent.clicks <= 1) |
2130 | selection_extend (ev.x, ev.y, 0); |
2136 | selection_extend (ev.x, ev.y, 0); |
2131 | |
2137 | |
2132 | if (HOOK_INVOKE ((this, HOOK_BUTTON_RELEASE, DT_XEVENT, &ev, DT_END))) |
|
|
2133 | return; |
|
|
2134 | |
|
|
2135 | switch (ev.button) |
2138 | switch (ev.button) |
2136 | { |
2139 | { |
2137 | case Button1: |
2140 | case Button1: |
2138 | case Button3: |
2141 | case Button3: |
2139 | selection_make (ev.time); |
2142 | selection_make (ev.time); |
2140 | break; |
2143 | break; |
2141 | |
2144 | |
2142 | case Button2: |
2145 | case Button2: |
2143 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2146 | if (IN_RANGE_EXC (ev.x, 0, width) && IN_RANGE_EXC (ev.y, 0, height)) // inside window? |
2144 | selection_request (ev.time, ev.state & ShiftMask ? Sel_Clipboard : Sel_Primary); |
2147 | selection_request (ev.time, ev.state & ModMetaMask ? Sel_Primary : Sel_Primary); |
2145 | break; |
2148 | break; |
2146 | |
2149 | |
2147 | #ifdef MOUSE_WHEEL |
2150 | #ifdef MOUSE_WHEEL |
2148 | case Button4: |
2151 | case Button4: |
2149 | case Button5: |
2152 | case Button5: |
… | |
… | |
2629 | am_transparent = 0; |
2632 | am_transparent = 0; |
2630 | /* XXX: also turn off Opt_transparent? */ |
2633 | /* XXX: also turn off Opt_transparent? */ |
2631 | } |
2634 | } |
2632 | else |
2635 | else |
2633 | { |
2636 | { |
2634 | #if WAIT_FOR_WM |
|
|
2635 | /* wait (an arbitrary period) for the WM to do its thing |
|
|
2636 | * needed for fvwm2.2.2 (and before?) */ |
|
|
2637 | sleep (1); |
|
|
2638 | #endif |
|
|
2639 | for (n = 0; n < (unsigned int)i; n++) |
2637 | for (n = 0; n < (unsigned int)i; n++) |
2640 | { |
2638 | { |
2641 | XSetWindowBackgroundPixmap (disp, parent[n], ParentRelative); |
2639 | XSetWindowBackgroundPixmap (disp, parent[n], ParentRelative); |
2642 | XClearWindow (disp, parent[n]); |
2640 | XClearWindow (disp, parent[n]); |
2643 | } |
2641 | } |
… | |
… | |
3310 | { |
3308 | { |
3311 | switch (priv) |
3309 | switch (priv) |
3312 | { |
3310 | { |
3313 | case '>': |
3311 | case '>': |
3314 | if (ch == CSI_DA) /* secondary device attributes */ |
3312 | if (ch == CSI_DA) /* secondary device attributes */ |
|
|
3313 | { |
|
|
3314 | // first parameter is normally 0 for vt100, 1 for some newer vtxxx, 'R' for rxvt, |
|
|
3315 | // 'U' for rxvt-unicode <= 7.2, and Mm85 (e.g. 7385 for 7.3) for later versions. |
|
|
3316 | // |
|
|
3317 | // second parameter is xterm patch level for xterm, MMmmpp (e.g. 20703) for rxvt |
|
|
3318 | // and Mm (e.g. 72 for 7.2) for urxvt <= 7.2, and 94 for later versions, to signify |
|
|
3319 | // that we do not support xterm mouse reporting (should be 95 when we do). |
|
|
3320 | // |
3315 | tt_printf ("\033[>%d;%c%c;0c", 'U', VERSION[0], VERSION[2]); |
3321 | tt_printf ("\033[>%c%c85;94;0c", VERSION[0], VERSION[1]); |
|
|
3322 | } |
3316 | break; |
3323 | break; |
3317 | case '?': |
3324 | case '?': |
3318 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
3325 | if (ch == 'h' || ch == 'l' || ch == 'r' || ch == 's' || ch == 't') |
3319 | process_terminal_mode (ch, priv, nargs, arg); |
3326 | process_terminal_mode (ch, priv, nargs, arg); |
3320 | break; |
3327 | break; |