-- Leo's gemini proxy
-- Connecting to git.thebackupbox.net:1965...
-- Connected
-- Sending request
-- Meta line: 20 text/gemini
repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 11de8f9fd2cc25d8a56bd9a1b5f851022c648a18: path_to: revision_to:
commit 11de8f9fd2cc25d8a56bd9a1b5f851022c648a18 Author: Marc Lehmann <schmorp@schmorp.de> Date: Tue Jan 3 17:34:44 2006 +0000 *** empty log message *** diff --git a/src/command.C b/src/command.C
--- a/src/command.C +++ b/src/command.C @@ -1797,6 +1797,7 @@ rxvt_term::button_press (XButtonEvent &ev) int reportmode = 0, clickintime; bypass_keystate = ev.state & (ModMetaMask | ShiftMask); + if (!bypass_keystate) reportmode = !! (priv_modes & PrivMode_mouse_report); @@ -1855,48 +1856,49 @@ rxvt_term::button_press (XButtonEvent &ev) if (ev.button != MEvent.button) MEvent.clicks = 0; - switch (ev.button) - { - case Button1: - /* allow meta + click to select rectangular areas */ - /* should be done in screen.C */ + if (!PERL_INVOKE ((this, HOOK_MOUSE_CLICK, DT_XEVENT, &ev, DT_END))) + switch (ev.button) + { + case Button1: + /* allow meta + click to select rectangular areas */ + /* should be done in screen.C */ #if ENABLE_FRILLS - selection.rect = !!(ev.state & ModMetaMask); + selection.rect = !!(ev.state & ModMetaMask); #else - selection.rect = false; + selection.rect = false; #endif - /* allow shift+left click to extend selection */ - if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) - { - if (MEvent.button == Button1 && clickintime) - selection_rotate (ev.x, ev.y); - else - selection_extend (ev.x, ev.y, 1); - } - else - { - if (MEvent.button == Button1 && clickintime) - MEvent.clicks++; - else - MEvent.clicks = 1; + /* allow shift+left click to extend selection */ + if (ev.state & ShiftMask && ! (priv_modes & PrivMode_mouse_report)) + { + if (MEvent.button == Button1 && clickintime) + selection_rotate (ev.x, ev.y); + else + selection_extend (ev.x, ev.y, 1); + } + else + { + if (MEvent.button == Button1 && clickintime) + MEvent.clicks++; + else + MEvent.clicks = 1; - selection_click (MEvent.clicks, ev.x, ev.y); - } + selection_click (MEvent.clicks, ev.x, ev.y); + } - MEvent.button = Button1; - break; + MEvent.button = Button1; + break; - case Button3: - if (MEvent.button == Button3 && clickintime) - selection_rotate (ev.x, ev.y); - else - selection_extend (ev.x, ev.y, 1); + case Button3: + if (MEvent.button == Button3 && clickintime) + selection_rotate (ev.x, ev.y); + else + selection_extend (ev.x, ev.y, 1); - MEvent.button = Button3; - break; - } - } + MEvent.button = Button3; + break; + } + } MEvent.time = ev.time; return; diff --git a/src/rxvtperl.h b/src/rxvtperl.h
--- a/src/rxvtperl.h +++ b/src/rxvtperl.h @@ -16,6 +16,7 @@ enum data_type { DT_INT, DT_LONG, DT_STRING, + DT_XEVENT, }; enum hook_type { @@ -29,6 +30,8 @@ enum hook_type { HOOK_SEL_MAKE, HOOK_SEL_GRAB, + HOOK_SEL_CLICK, + HOOK_FOCUS_IN, HOOK_FOCUS_OUT, @@ -41,6 +44,9 @@ enum hook_type { HOOK_KEYBOARD_COMMAND, + HOOK_MOUSE_CLICK, + HOOK_MOUSE_MOVE, + HOOK_NUM, }; diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs +++ b/src/rxvtperl.xs @@ -474,6 +474,7 @@ BOOT: set_hookname (SEL_EXTEND); set_hookname (SEL_MAKE); set_hookname (SEL_GRAB); + set_hookname (SEL_CLICK); set_hookname (FOCUS_IN); set_hookname (FOCUS_OUT); set_hookname (VIEW_CHANGE); @@ -482,6 +483,8 @@ BOOT: set_hookname (REFRESH_BEGIN); set_hookname (REFRESH_END); set_hookname (KEYBOARD_COMMAND); + set_hookname (MOUSE_CLICK); + set_hookname (MOUSE_MOVE); export_const (DEFAULT_RSTYLE); export_const (OVERLAY_RSTYLE); diff --git a/src/screen.C b/src/screen.C
--- a/src/screen.C +++ b/src/screen.C @@ -3325,8 +3325,11 @@ rxvt_term::selection_extend_colrow (int32_t col, int32_t row, int button3, int b if (ROWCOL_IS_AFTER (selection.end, selection.beg)) selection.end.col--; - selection_delimit_word (UP, &selection.beg, &selection.beg); - selection_delimit_word (DN, &selection.end, &selection.end); + if (!PERL_INVOKE ((this, HOOK_SEL_EXTEND, DT_END))) + { + selection_delimit_word (UP, &selection.beg, &selection.beg); + selection_delimit_word (DN, &selection.end, &selection.end); + } } else if (selection.clicks == 3) {
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 12:23:29 2024