aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-curses
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2025-06-15 21:46:33 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2025-06-15 22:18:16 +0300
commit07b71f4f8b25de7bedf1dd5e5397497851149126 (patch)
tree13fe536ea6843caf5e7d9ca6d97836bb589a8da3 /src/interface-curses
parentc6ee5fd86e1db6b81632ddb259d595dfa5a4e8ad (diff)
downloadsciteco-07b71f4f8b25de7bedf1dd5e5397497851149126.tar.gz
require and adapted to PDCurses v4.5.1
* PDCurses is practically used only for Windows builds, which only I build presumably, so it should be okay to bump the version. * Older PDCurses versions had serious problems like not detecting BUTTONX_RELEASED events. This was worked around and is fixed now. Even the Wincon version behaves like ncurses now with regard to mouse events. * We no longer have to support processing BUTTONX_CLICKED events. On the downside the mouse mask had to be adapted. * See also https://github.com/Bill-Gray/PDCursesMod/issues/330 * We also no longer have to call resize_term(0,0).
Diffstat (limited to 'src/interface-curses')
-rw-r--r--src/interface-curses/interface.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/interface-curses/interface.c b/src/interface-curses/interface.c
index b653818..565001f 100644
--- a/src/interface-curses/interface.c
+++ b/src/interface-curses/interface.c
@@ -1915,15 +1915,23 @@ static gint
teco_interface_blocking_getch(void)
{
#if NCURSES_MOUSE_VERSION >= 2
+#ifdef __PDCURSES__
+ /*
+ * On PDCurses it's crucial NOT to mask for BUTTONX_CLICKED.
+ * Scroll events are not reported without the non-standard MOUSE_WHEEL_SCROLL.
+ */
+ static const mmask_t mmask = BUTTON_EVENT(PRESSED) | BUTTON_EVENT(RELEASED) |
+ MOUSE_WHEEL_SCROLL;
+#else
/*
- * FIXME: REPORT_MOUSE_POSITION is necessary at least on
+ * REPORT_MOUSE_POSITION is necessary at least on
* ncurses, so that BUTTONX_RELEASED events are reported.
* It does NOT report every cursor movement, though.
- * What does PDCurses do?
*/
- mousemask(teco_ed & TECO_ED_MOUSEKEY
- ? ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION : 0, NULL);
+ static const mmask_t mmask = ALL_MOUSE_EVENTS | REPORT_MOUSE_POSITION;
#endif
+ mousemask(teco_ed & TECO_ED_MOUSEKEY ? mmask : 0, NULL);
+#endif /* NCURSES_MOUSE_VERSION >= 2 */
/* no special <CTRL/C> handling */
raw();
@@ -1977,10 +1985,6 @@ teco_interface_event_loop_iter(void)
return;
#ifdef KEY_RESIZE
case KEY_RESIZE:
-#ifdef __PDCURSES__
- /* NOTE: No longer necessary since PDCursesMod v4.3.3. */
- resize_term(0, 0);
-#endif
teco_interface_resize_all_windows();
break;
#endif