Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scrolling artifacts on Windows after some idle time #619

Open
jdhao opened this issue Dec 19, 2019 · 10 comments
Open

scrolling artifacts on Windows after some idle time #619

jdhao opened this issue Dec 19, 2019 · 10 comments

Comments

@jdhao
Copy link

jdhao commented Dec 19, 2019

I have got scrolling artifacts on the screen on Windows after nvim-qt has been idle for some time.
See the white vertical line in the blow image.

image

Clicking mouse cursor in the screen will update the screen and clear the artifacts. I have not observed this for previous versions of nvim-qt. This happens only recently.

The nvim-qt is bundled with nvim nightly version: NVIM v0.5.0-172-g1ff5b60cb

@jgehrig
Copy link
Collaborator

jgehrig commented Dec 19, 2019

These look similar to the artifacts I see on Linux as a result of display scaling.

Is display scaling set to 100%? Does this issue persist with 100% display scaling?

I haven't seen this issue, but I will keep an eye out. If you can provide deterministic steps to reproduce the issue, that would be helpful.

@jdhao
Copy link
Author

jdhao commented Dec 20, 2019

Yeah, the Windows display scale is 100% and the screen resolution is set to 1920 x 1080.

@jdhao
Copy link
Author

jdhao commented Dec 21, 2019

@jgehrig I think I can reproduce this issue now. It has something to do with the mouse wheel setting.

  • open nvim-qt with the following cofing (nvim-qt -- -u init.vim)
set mouse=nic
nnoremap <silent> <ScrollWheelDown> j
nnoremap <silent> <ScrollWheelUp>   k
  • Open a file
  • click other window or places to make the focus lost for nvim-qt
  • Move the mouse cursor back to nvim-qt but not click the current buffer
  • scroll the mouse wheel down or up, and you will see those artifacts

image

I am also confused that placing the mouse cursor on the nvim-qt window will activate it so that I can use mouse scroll to move the cursor inside nvim-qt. I thought that only after clicking the nvim-qt window, will we be able to activate it and use the mouse wheel to scroll.

@jgehrig
Copy link
Collaborator

jgehrig commented Dec 21, 2019

I can't quite reproduce the exact scenario, but I see similar issues when the cursor "bounces" off the screen edge in an inactive state. The issue appears on Linux/Windows with 100% scaling.

The cursor outline disappears only after a "bounce" off the screen edge. Recorded with ScreenToGif.

output

Do you think this could be the cause of your display artifacts? If not, maybe they are related...

I am also confused that placing the mouse cursor on the nvim-qt window will activate it so that I can use mouse scroll to move the cursor inside nvim-qt. I thought that only after clicking the nvim-qt window, will we be able to activate it and use the mouse wheel to scroll.

That is odd... Qt sends mouse scroll event to inactive windows. There is probably an OS setting somewhere. Linux behaves the same way on my computer.

@jdhao
Copy link
Author

jdhao commented Dec 22, 2019

I think they are similar if not the same issue. The solid cursor shape becomes hollow. When you scroll the mouse wheel, it produces the display artifacts.

@jgehrig
Copy link
Collaborator

jgehrig commented Dec 22, 2019

My screen capture is scrolled with the mouse wheel too. It sounds similar, but not exactly the same.

I will take a look at the screen edge case some time. Maybe that case will provide some insight for both cases.

@jgehrig
Copy link
Collaborator

jgehrig commented Dec 30, 2019

@jdhao

The logic for cursor rendering is straightforward; active cursors are inverted and inactive cursors are printed as a empty rectangle. I suspect this is a bug in Qt's rendering engine...

Can you try adjusting the scaling factor to see if this issue persists?

https://doc.qt.io/qt-5/highdpi.html#high-dpi-support-in-qt

@jdhao
Copy link
Author

jdhao commented Dec 30, 2019

I tried to change the display scale to 125%, 150% or 175%, but the issue still persists. The image below is captured using 125% scale.

image

@jgehrig
Copy link
Collaborator

jgehrig commented Dec 30, 2019

I suspect this is a bug in Qt... Did you make the changes via set QT_SCALE_FACTOR? I cannot reproduce without setting a problematic scale factor like 1.3.

It would be useful to know which version of Qt this was built against. It is a shame you can't use #616 yet.

It would be nice to know if this scenario behaves differently for different versions of Qt, if you can build the app from source.

@jdhao
Copy link
Author

jdhao commented Dec 30, 2019

No, I change the scale in Windows 10 settings in System --> Display --> Scale and layout.

Sorry, I can not build this from source. It is a work computer and I have neither qt or MSVC installed...

The Nvim-qt I am currently using is bundled with Neovim, and the neovim version is (from :version):

NVIM v0.5.0-172-g1ff5b60cb
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe /DWIN32 /D_WINDOWS /W3 /MD /Zi /O2 /Ob1 /DNDEBUG -DMIN_LOG_LEVEL=3 /W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -DWIN32 -D_WIN32_WINNT=0x0600 -DINCLUDE_GENERATED_DECLARATIONS -DUTF8PROC_STATIC -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -IC:/projects/neovim/build/config -IC:/projects/neovim/src -IC:/projects/nvim-deps/usr/include -IC:/projects/neovim/build/src/nvim/auto -IC:/projects/neovim/build/include
Compiled by appveyor@APPVYR-WIN

Features: -acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM\sysinit.vim"
  fall-back for $VIM: "C:/Program Files/nvim/share/nvim"

Run :checkhealth for more info

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

No branches or pull requests

2 participants