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

High DPI scaling and font issues in Version 1.2.1335 #5098

Closed
ReveStobinson opened this issue Jul 12, 2019 · 8 comments · Fixed by #5753
Closed

High DPI scaling and font issues in Version 1.2.1335 #5098

ReveStobinson opened this issue Jul 12, 2019 · 8 comments · Fixed by #5753

Comments

@ReveStobinson
Copy link

@ReveStobinson ReveStobinson commented Jul 12, 2019

I have a laptop with a High-DPI screen (3840x2160 13in. display) and I'm experiencing a couple of issues that I believe are related to how RStudio deals with High-DPI scaling. I have the Windows "fix scaling" turned on, as well as having my applications zoomed in to 300%, the recommended for my display.

The first issue has to do with scrolling in the editor and console. I have my mouse settings currently set to scroll 3 lines at a time, but changing this setting has no effect on how fast I can scroll in the console. RStudio scrolls ~11 lines at a time, which is almost a full window in the editor. This makes navigating my scripts very challenging and frustrating. Zooming in or out on RStudio (from the View dropdown menu) does not change this, but changing the font size does. When I lower the font size, it scrolls more lines, and if I increase the font size it scrolls far fewer lines. Important to note also is that this slightly different when viewing dataframe or tables in the view window. It scrolls 3-4 lines at a time, like I would expect, but this does not change when I change my system settings, so it seems to be some fixed setting there as well. I suspect this is somehow related to font scaling settings.

The other issue is that when in the view window, viewing a dataframe or table, the horizontal scroll bar is very thin, almost invisible. Here's a screenshot so you can see what I mean.
image

I've tried running the app in various compatibility modes, as well as overriding the scaling settings in every combination possible. Either the app is very blurry and both issues are resolved, or the app looks fine but both issues are still present. I should also note that when I connect my lower-resolution wireless display (1366x768) and drag the RStudio window over to it, the problems are not present while it is on that screen. That does suggest that multi-DPI functionality is not necessarily an issue (referenced in #2135), just High-DPI scaling.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Jul 12, 2019

For extra information?

  1. What kind of laptop do you have? (so that we could try and reproduce the issue in-house)
  2. Does switching to software rendering make a difference? https://support.rstudio.com/hc/en-us/articles/360017886674-Troubleshooting-RStudio-Rendering-Errors

@ReveStobinson
Copy link
Author

@ReveStobinson ReveStobinson commented Jul 12, 2019

  1. I have an HP Spectre x360 13t running Windows 10 1903, though this issue has always occurred, even before 1903. Specs are as here:
    image I think I heard HP makes their own display drivers or something like that, instead of using the Windows ones, so that could very well be part of the problem too.

  2. Switching to software rendering didn't change anything. Nor did switching to OpenGL.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Jul 12, 2019

Thanks -- I was able to reproduce this on my Windows VM as well. Looks like it reproduces only when using a dark theme, and it does reproduce for any UI scaling other than 100%.

@ReveStobinson
Copy link
Author

@ReveStobinson ReveStobinson commented Jul 12, 2019

Interesting--never thought to change themes! Yes, I switched to a light theme and the horizontal scroll bar in the data view window looked normal! Still had the issue of scrolling ~11 lines at a time in the editor with different themes, but good to know I can scroll through data a bit easier now! Thanks.

(I've attached a ~1min long video of the editor scrolling at different font sizes and zooms if you'd like to see what that looks like)
Scrolling.zip

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Jul 12, 2019

Thanks! That's helpful. I can confirm something similar -- I have my Windows mouse settings to scroll 3 lines at a time, but I see ~9 lines scrolled on every 'tick' of the mouse scrollwheel. I only see this in the Source pane; not in the Console pane.

Since the problems here seem to be fairly well-understood I'm going to try and target this for v1.3.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Nov 16, 2019

Implementation notes:

  • Listen for Window move event / resize event, and check screen number after move complete.

https://doc.qt.io/qt-5/qwidget.html#moveEvent
https://doc.qt.io/qt-5/qwidget.html#resizeEvent

  • Check screen number; see if it's changed.

https://doc.qt.io/qt-5/qguiapplication.html#screenAt

  • If it has, check the scaling factor set for that screen.

https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-getscalefactorformonitor

  • Notify client when scale factor has changed.

https://ace.c9.io/api/editor.html#Editor.setScrollSpeed

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Nov 18, 2019

This can be solved much more simply: just monitor window.devicePixelRatio and update the scroll speed as that changes. Phew!

@aja08379
Copy link

@aja08379 aja08379 commented Apr 1, 2020

Customer asking whether this can be changed to a user configurable value?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants