WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.39k stars 179 forks source link

Scale plugin go crazy #1141

Closed tavoda closed 3 years ago

tavoda commented 3 years ago

Describe the bug Scale plugin go crazy

To Reproduce

  1. Enable scale plugin
  2. set 'duration = 300'
  3. set 'toggle_all = KEY_W | hotspot top-left 10x10 200'
  4. When you go to top left corner and stay there with mouse, very often scale plugin start for about 100ms, return back, than again start, than return back ... sometimes it ends with with scale plugin on, sometimes off.

Expected behavior Scale plugin should start

Wayfire version 0.7.0-30f13ab3 (Apr 4 2021, branch 'HEAD')

tavoda commented 3 years ago

It look like problem with optical mouse. It's on same place but new event is generated. That leads to this back and forth behavior. Is it possible to handle in wayfire?

ammen99 commented 3 years ago

Yes, we should not emit the event multiple times if the mouse stays in the region, even if it is moving. Shouldn't be very difficult, the only adjustments need to be done here: https://github.com/WayfireWM/wayfire/blob/master/src/core/seat/hotspot-manager.cpp#L3

tavoda commented 3 years ago

@ammen99 what are you using for development? After Java, going back 20 years with C++ with pure VIM is huge pain.

ammen99 commented 3 years ago

@ammen99 what are you using for development? After Java, going back 20 years with C++ with pure VIM is huge pain.

I'll disappoint you, I am using NeoVim. What I'd recommend is getting a few plugins on it, otherwise, it would be quite unusable ;)

What I think are the most important plugins:

Of course, you may prefer to just use VSCode or similar. Meson provides a compile_commands.json file which provides compilation flags which can be used by many editors/plugins.

tavoda commented 3 years ago

Thanks @ammen99, I will try to add this, I have 'similar' setup for JS and React. If it is not secret can you share your vimrc or at least 'Plugin' section for C++?

JordanL2 commented 3 years ago

If it helps here's mine:

" Plugins call plug#begin() Plug 'dense-analysis/ale' Plug 'neoclide/coc.nvim', {'branch': 'release'} Plug 'jackguo380/vim-lsp-cxx-highlight' Plug 'preservim/nerdtree' Plug 'Xuyuanp/nerdtree-git-plugin' Plug 'vim-airline/vim-airline' Plug 'liuchengxu/vista.vim' Plug 'mhinz/vim-startify' call plug#end()

ammen99 commented 3 years ago

Thanks @ammen99, I will try to add this, I have 'similar' setup for JS and React. If it is not secret can you share your vimrc or at least 'Plugin' section for C++?

Here it is, I don't know how useful it will be since it has a ton of stuff accumulated over the years, without much organization.

vimrc.txt

tavoda commented 3 years ago

:sunglasses: thanks

JordanL2 commented 3 years ago

I've raised this PR to fix the issue: https://github.com/WayfireWM/wayfire/pull/1159