gh-152502: Detect the curses mouse interface and is_* methods portably#152705
Merged
serhiy-storchaka merged 1 commit intoJun 30, 2026
Merged
Conversation
…ortably The mouse interface (getmouse(), has_mouse(), the BUTTON* constants, window.mouse_trafo(), ...) and the window is_*() state-query methods were gated on ncurses-specific macros, so they were dropped on other curses implementations that provide them, such as NetBSD curses and PDCurses. Gate them instead on configure capability probes (for functions NetBSD curses provides, since it defines no identifying macro) or on NCURSES_EXT_FUNCS or the PDCURSES macro (for functions only ncurses and PDCurses provide). Probe for getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses declares an incompatible getmouse(void) unless built for the ncurses mouse API, which PDC_NCMOUSE now always selects. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Documentation build overview
|
|
GH-152707 is a backport of this pull request to the 3.15 branch. |
serhiy-storchaka
added a commit
that referenced
this pull request
Jun 30, 2026
…) (GH-152707) The mouse interface (getmouse(), the BUTTON* constants, ...) was gated on the ncurses-specific NCURSES_MOUSE_VERSION macro, so it was dropped on other curses implementations that provide it, such as NetBSD curses and PDCurses. Gate it instead on a configure capability probe or the PDCURSES macro. Probe for getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses declares an incompatible getmouse(void) unless built for the ncurses mouse API, which PDC_NCMOUSE now always selects. (cherry picked from commit 7bbea4f) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jul 1, 2026
|
GH-152734 is a backport of this pull request to the 3.14 branch. |
|
GH-152735 is a backport of this pull request to the 3.13 branch. |
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 1, 2026
…) (GH-152735) The mouse interface (getmouse(), the BUTTON* constants, ...) was gated on the ncurses-specific NCURSES_MOUSE_VERSION macro, so it was dropped on other curses implementations that provide it, such as NetBSD curses and PDCurses. Gate it instead on a configure capability probe or the PDCURSES macro. Probe for getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses declares an incompatible getmouse(void) unless built for the ncurses mouse API, which PDC_NCMOUSE now always selects. (cherry picked from commit 7bbea4f) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 1, 2026
…) (GH-152734) The mouse interface (getmouse(), the BUTTON* constants, ...) was gated on the ncurses-specific NCURSES_MOUSE_VERSION macro, so it was dropped on other curses implementations that provide it, such as NetBSD curses and PDCurses. Gate it instead on a configure capability probe or the PDCURSES macro. Probe for getmouse() with its X/Open getmouse(MEVENT *) signature, since PDCurses declares an incompatible getmouse(void) unless built for the ncurses mouse API, which PDC_NCMOUSE now always selects. (cherry picked from commit 7bbea4f) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The curses mouse interface (
getmouse(),has_mouse(), theBUTTON*constants,window.mouse_trafo(), ...) and the windowis_*()state-query methods were gated on ncurses-specific macros (NCURSES_MOUSE_VERSION,NCURSES_EXT_FUNCS), so they were dropped on other curses implementations that provide them, such as NetBSD curses and PDCurses (the latter underpinswindows-curses).They are now gated on:
NCURSES_EXT_FUNCSor thePDCURSESmacro, for functions that only ncurses and PDCurses provide.getmouse()is probed with its X/Opengetmouse(MEVENT *)signature specifically, because PDCurses declares an incompatiblegetmouse(void)unless built for the ncurses mouse API.PDC_NCMOUSEis now always defined so PDCurses exposes that ncurses-compatible mouse interface, which is the one this module uses, and Windows gets the whole API through thePDCURSESmacro with no configure step.Validated by compiling against ncurses (plus
test_curses), NetBSD curses, PDCurses with and withoutPDC_NCMOUSE, and the PDCurses-on-Windows path.