bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.23k stars 54 forks source link

[BUG] Drag target in WindowManager isn't sticky #15

Closed bczsalba closed 2 years ago

bczsalba commented 2 years ago

Describe the bug When dragging (LEFT_CLICK & no release) the WM activates a new target every time it moves over one

To Reproduce

  1. Create a WindowManager instance
  2. Add a Window with {"Test": ["Button"]} as on of its element
  3. Try resizing the window from the right, where the button is
  4. The button will keep being activated even though you are trying to resize the window

Expected behavior The window manager should remember what the last targeted widget was, so when the mouse moves faster than the program can keep up the behaviour isn't undefined.

System information

PyTermGUI v1.1.0+
Python: 3.9.9
Platform: macOS-12.0.1-arm64-arm-64bit
Git commit: 7374236

Possible cause WindowManager._drag_target is set too often.

Possible solution Fix possible cause.