[Lldb-commits] [PATCH] D82522: [lldb/IOHandlerCursesGUI] Make the menu bar clickable
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jun 25 11:20:56 PDT 2020
clayborg added a comment.
I wrote all this, so feel free to contact me directly with questions! It would be nice to pass the events along to the window or object for the mouse coordinates. See inlined comment and let me know what you think.
================
Comment at: lldb/source/Core/IOHandlerCursesGUI.cpp:1085
+ if (event.bstate & BUTTON1_PRESSED) {
+ int selected = GetSubmenuForPosition(event.x, event.y);
+ if (selected < static_cast<int>(num_submenus)) {
----------------
It might be nice for this to be a bit more generic and be GetWindowForPosition(...). If we are going to enable mouse support, it would be nice to pass the mouse clicks to the windows and let them handle the clicks. Something like:
```
auto window = GetWindowForPosition(event.x, event.y);
if (window)
result = window->HandleMouseButtonPressed(event);
```
The HandleMouseButton will return eKeyHandled if it handled the press. We might also allow other button presses to be passed along for right click and center clicks.
Then menu bars can handle the clicking. We might also want to pass
Repository:
rLLDB LLDB
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82522/new/
https://reviews.llvm.org/D82522
More information about the lldb-commits
mailing list