Skip to content

gh-154511: IDLE - Update mousewheel event handling #154512

Open
terryjreedy wants to merge 2 commits into
python:mainfrom
terryjreedy:x11wheel
Open

gh-154511: IDLE - Update mousewheel event handling #154512
terryjreedy wants to merge 2 commits into
python:mainfrom
terryjreedy:x11wheel

Conversation

@terryjreedy

@terryjreedy terryjreedy commented Jul 22, 2026

Copy link
Copy Markdown
Member

Move x11_buttons boolean and wheel_event function
to util.py.  Move test to test_util.
@terryjreedy

terryjreedy commented Jul 22, 2026

Copy link
Copy Markdown
Member Author

Quick manual checks on linux and macOS would be nice: load a non-trivial file such as editor.py and scroll up and down. Scrolling in a sidebar should not be affected by this PR. Open a module browser and expand enough to scroll both over the items and in the blank space. @StanFromIreland I forget whether you have mac or only linux.

EDIT: I have done the above on Windows and the unittest is system independent, as it patches the x11 indicator (which Serhiy wrote and tested on x11.)

@StanFromIreland

Copy link
Copy Markdown
Member

@StanFromIreland I forget whether you have mac or only linux.

Only Linux, maybe ask a Mac expert to test it on a Mac.

Comment thread Lib/idlelib/util.py
# On X11, Tk 8.6- signals mouse wheel rotations with <Button-4> and
# <Button-5> events. With 8.7+, it generates <Mousewheel events
# as on other systems. Used here, editor, tree, and test_sidebar.
x11_buttons = (tkinter.BaseWidget._windowingsystem == 'x11' and

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: x11_buttons is always false.

_windowingsystem is a property, and it's accessed here on the class, not an instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants