daa84 / neovim-gtk

gtk ui for neovim
GNU General Public License v3.0
718 stars 56 forks source link

Enable scrolling with smooth scroll #32

Closed christopher-l closed 6 years ago

christopher-l commented 6 years ago

Still doesn't scroll smoothly, but enables scrolling when only smooth scroll events are emitted.

Not too sure what I'm doing here, so please tell if I used things in ways that weren't intended.

daa84 commented 6 years ago

Hello! Sorry for long response. As i understand this is pixel level scrolling. It is possible to emulate it by storing previous and next state of ui_model while process on_scroll event, but it looks like complex task.

christopher-l commented 6 years ago

Hi, Yes, actual pixel scrolling would be quite hard I guess. However, the reason for my pull request was that even normal scrolling didn't work on my laptop. So I tried to use the smooth scroll events to get normal scrolling, where mouse wheel events aren't available. Maybe, there is another way to get the system to pass normal scroll events to the application, but by default, it doesn't seem to always do that.

daa84 commented 6 years ago

Ok, then if it work for you i can merge it.

christopher-l commented 6 years ago

Yes, for me it works. I just wasn't sure, whether UiState was the correct place to put the saved delta values.

daa84 commented 6 years ago

UiState is ok 👍 Thanks