Skip to content

Conversation

bfredl
Copy link
Member

@bfredl bfredl commented Jan 1, 2019

Needs more tests (and likely edge cases to fix). Also docs, as far as I can see the existing <LeftMouse><2,1> format hasn't been properly documented, should probably go in ui.txt.

ref #9421

@marvim marvim added the WIP label Jan 1, 2019
@bfredl bfredl mentioned this pull request Jan 1, 2019
23 tasks
@bfredl
Copy link
Member Author

bfredl commented Jan 5, 2019

Instead of extending the nvim_input("<LeftMouse><col,row>") format, should we introduce nvim_mouse_input(button,event,grid,row,col) API method, and deprecate the stringly format? It seems nvim_input("<LeftMouse><20,6><LeftDrag><20,5>") doesn't work (need two separate calls), so these do not work like ordinary keys anyway.

@bfredl
Copy link
Member Author

bfredl commented Jan 13, 2019

Began nvim_mouse_input(button,event,modifier,grid,row,col) sketch (except for missing modifiers).

@justinmk first iteration will not support "queued" mouse events, it will be interactive GUI support only as nvim_input. I might do it later, but the priority now should be to make multigrid mouse work, and with a sustainable API.

@bfredl bfredl force-pushed the grid_mouse branch 3 times, most recently from 4e51b05 to 7808250 Compare January 19, 2019 11:47
@bfredl bfredl changed the title [WIP] ui: multigrid mouse support API/UI: add nvim_input_mouse() including multigrid mouse support Jan 19, 2019
@bfredl
Copy link
Member Author

bfredl commented Jan 19, 2019

Added modifier support (and tests), it should be feature complete. (Except for mouse redraw failure, marked in tests)

@bfredl bfredl force-pushed the grid_mouse branch 3 times, most recently from cc6e8dd to 9b86be2 Compare January 19, 2019 15:13
@bfredl
Copy link
Member Author

bfredl commented Jan 19, 2019

While working on this I identified that terminal_resize is not used correctly with multigrid. I will fix/refactor it in a separate PR tough, as it looks a bit complex. (like: why does it both take width as parameter and try to calculate width from windows at the same time? what does the terminal_resize(wp, 0, 0) call do, nothing?)

@codecov

This comment has been minimized.

@bfredl
Copy link
Member Author

bfredl commented Jan 19, 2019

Fixed the remaining error (calculate cursor pos after vertical resize).

/// that the "-" separator is optional, so "C-A-", "c-a"
/// and "CA" can all be used to specify Ctrl+Alt+click
/// @param grid For a client using |ui-multigrid| pass in the grid number.
/// Other clients should pass in 0 (not 1).
Copy link
Member

Choose a reason for hiding this comment

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

what happens if a ext_multigrid client sends 0?

Copy link
Member Author

Choose a reason for hiding this comment

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

The difference is primarily for floats. Both a TUI-like and a multigrid client could be connected at the same time, then 0 would correspond to the TUI grid where floats have been merged in (so float clicks should be detected), while 1 is only the default grid without floats (because the client will manage the positions of floats itself). I will expand on the docs in the float PR itself.

@justinmk
Copy link
Member

While working on this I identified that terminal_resize is not used correctly with multigrid. I will fix/refactor it in a separate PR tough, as it looks a bit complex. (like: why does it both take width as parameter and try to calculate width from windows at the same time? what does the terminal_resize(wp, 0, 0) call do, nothing?)

terminal_resize is in a weird state. There is at least one pending PR for it. I've also been meaning to revisit it.

@bfredl
Copy link
Member Author

bfredl commented Jan 20, 2019

Thanks, updated.

@bfredl bfredl merged commit 62254d2 into neovim:master Jan 20, 2019
@justinmk justinmk removed the WIP label Jan 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants