Package: ncurses-doc
Version: 6.4+20231121-1
Severity: normal
File: /usr/share/man/man3/mouse.3ncurses.gz

Dear Maintainer,

Quoting the manual:
  The wmouse_trafo function transforms a given pair of coordinates
  from stdscr-relative coordinates to coordinates relative to the
  given window or vice versa.
  • If the parameter to_screen is TRUE, the pointers pY, pX must
    reference the coordinates of a location inside the window win.
    They are converted to window-relative coordinates and returned
    through the pointers. If the conversion was successful, the
    function returns TRUE.
  • If to_screen is FALSE, the pointers pY, pX must reference
    window-relative coordinates. They are converted to stdscr-relative
    coordinates if the window win en‐ closes this point. In this
    case the function returns TRUE.

So, if to_screen is true, then the coordinates are converted from screen
to window coordinates?
And if to_screen is false, then window corrdinates are converted to
screen coordinates?

Given
  -stdscr------------
  |                 |
  |                 |
  |                 |
  |     -win------  |
  |     |x       |  |
  |     |        |  |
  |     |        |  |
  |     |________|  |
  |_________________|
I should expect wmouse_trafo(win, &1, &1, true)  to yield 6, 6,
            and wmouse_trafo(win, &6, &6, false) to yield 1, 1?
(And both wmouse_trafo(win, &1, &1, false)
      and wmouse_trafo(win, &6, &6, true)  to return false?)

Or, to put it bluntly, is the to_screen parameter actually to_window,
and not to_screen?

What is the purpose of mouse_trafo() if a stdscr/stdscr mapping is
a no-op? Is the first sentence conflating the stdscr window with
the physical, uh, window^Wscreen^Wdisplay?

Best,
наб

-- System Information:
Debian Release: 12.4
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 
'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.1.0-9-amd64 (SMP w/24 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_FIRMWARE_WORKAROUND, 
TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

-- no debconf information

Attachment: signature.asc
Description: PGP signature

Reply via email to