BBS:      TELESC.NET.BR
Assunto:  src/syncterm/bbslist.c menu.c src/syncterm/scripts/syncterm.wren ui_ap
De:       Deuc¨
Data:     Fri, 1 May 2026 10:22:04 -0700
-----------------------------------------------------------
https://gitlab.synchro.net/main/sbbs/-/commit/eb2468e72ad03c81ec169413
Modified Files:
	src/syncterm/bbslist.c menu.c src/syncterm/scripts/syncterm.wren ui_app.wren ui_list.wren src/syncterm/term.c term.h wren_bind.c wren_bind_screen.c
Log Message:
SyncTERM: mouse drag-select cleanup for Wren App mode

Three related fixes so drag-to-select-and-copy works correctly while
a Wren App is up:

1. ui_app.wren / dispatchMouse_:
   - Stop ungetmouse'ing the BUTTON_1_DRAG_START before calling
     mousedrag().  mousedrag's switch treats anything that isn't
     MOUSE_MOVE / BUTTON_1_DRAG_MOVE as the end-of-drag arm  so
     feeding it the start event made it copy an empty selection
     and exit on iteration 1, leaving the actual drag-MOVE / DRAG_END
     events stranded for the next interaction (visible symptom: the
     copy from drag N didn't happen until drag N+1 started).
     conio preserves startx/y across drag events, so mousedrag's
     first DRAG_MOVE already has the right anchor  no unget needed.
   - Add an _dragHandedOff flag set after Input.mousedrag() returns;
     if a stray DRAG_END / button1Release ever leaks into Wren's
     queue (backend race, etc.) we silently swallow it instead of
     dropping it on a widget that didn't expect it.

2. ui_list.wren / handle:
   - Outside the scrollbar, accept only Press/Click for row
     selection.  Drag events used to also pick a row, so dragging
     across the list captured the drag and prevented the C-side
     selector from running  now drag-start falls through to
     dispatchMouse_ for text selection.  Scrollbar drag is
     unchanged.

3. C-side mousedrag  force-rect option:
   - term.h, term.c: mousedrag(scrollback, force_rect).  When
     force_rect is true, rect_mode starts true and mode_locked
     starts true, so Alt no longer toggles between line and rect.
   - term.c, bbslist.c, menu.c: existing C callers pass false
     (preserve Alt-toggle behavior).
   - wren_bind_screen.c / wren_bind.c / syncterm.wren: optional
     bool parameter on Input.mousedrag().  ui_app passes true;
     line-mode select is meaningless across cell-aligned widget
     chrome, users almost always want a rectangle.

Co-Authored-By: Claude Opus 4.7 (1M context) 
n
---
  mSynchronetn  hgVertrauen n hHome of Synchronet n gh[vert/cvs/bbs].synchro.net

-----------------------------------------------------------
[Voltar]