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

Cursor persists on previous line with new OpenGL rendering engine #4390

Closed
DesiQuintans opened this issue Mar 3, 2019 · 17 comments
Closed

Comments

@DesiQuintans
Copy link

@DesiQuintans DesiQuintans commented Mar 3, 2019

System details

RStudio Edition : Desktop
RStudio Version : 1.2.1303
OS Version      : Windows 7 64-bit
R Version       : 3.5.2

Steps to reproduce the problem

  1. Check that the rendering settings are at their default settings (below). In Windows, this will make RStudio try to use the desktop OpenGL renderer.

image

  1. Create a new R script file with this example text:
a 
b 
c 
d 
  1. Place the cursor on any line. Notice that there is a white dot blinking about 2x faster than the cursor, located 1 character behind the cursor's current location. If the cursor is at the start of the line, it will even draw itself on top of the gutter.
  2. Use the arrow keys to move the cursor between lines. The dot stays in the same place.
  3. Use the mouse to put the cursor on a different line. The dot will move itself to the line where the cursor used to be.
  4. Try changing the rendering options by enablind and disabling the three rendering checkboxes in any combination that you like. The problem will persist.
  5. Change rendering to force Software rendering, and the problem will go away.

Describe the problem in detail

cursor bug

Interestingly, my cursor is set to a lilac colour by my RStudio theme but the blinking dot is pure white (#FFFFFF), and I don't use that colour anywhere in my theme. The only place it appears in the theme is in the baked definitions for terminal colours.

.xtermColor231 { color: #ffffff !important; }
.xtermBgColor231 { background-color: #ffffff; }

Describe the behavior you expected

No part of the cursor should not persist on previous lines.

@DesiQuintans DesiQuintans changed the title Cursor persists on previous line with new rendering engine Cursor persists on previous line with new OpenGL rendering engine Mar 3, 2019
@grawil
Copy link

@grawil grawil commented Mar 8, 2019

This has been an issue for me too since at least as far back as mid-Jan (1.2.1239, maybe earlier). I am also using Windows 7 64-bit.

@ronblum ronblum added the bug label Mar 8, 2019
@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Mar 11, 2019

Not to be a downer, but Windows 7 is now nearly a 10 year old operating system, and is less than a year away from end of support from Microsoft.

If the issue occurs in Windows 7 but not Windows 10, then it's unlikely that we'll fix it.

@DesiQuintans
Copy link
Author

@DesiQuintans DesiQuintans commented Mar 11, 2019

Hi @kevinushey, thanks for prompting that. I am able to reproduce the bug on my university machine:

RStudio Edition : Desktop
RStudio Version : 1.2.1322-2
OS Version      : Windows 10 Enterprise 64-bit
R Version       : 3.5.2

Built-in graphics processor, Intel HD Graphics 630

The way the bug presents itself on this platform is different. Instead of going to the last position of the cursor, the flashing dot is now stuck on the cursor position of the last typed text. Clicking the cursor to a new position no longer moves the dot, it's now only moved by typing new input.

cursor dot

Windows 10 also seems to not activate the OpenGL renderer when it's set to auto-detect? This only happens when the renderer is specifically set to OpenGL. Whether the GPU blacklist and driver bug workarounds options are enabled or disabled makes no difference.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Mar 12, 2019

Interesting; thanks.

We disable the GPU by default for these integrated Intel graphics cards as a number of users have reported issues with them in the past when enabled. See e.g.

QString inferDefaultRenderingEngine()
{
if (::GetSystemMetrics(SM_REMOTESESSION))
{
// use software rendering over remote desktop
return QStringLiteral("software");
}
// prefer software rendering for certain graphics cards
std::vector<std::string> blacklist = {
"Intel(R) HD Graphics 520",
"Intel(R) HD Graphics 530",
"Intel(R) HD Graphics 620",
"Intel(R) HD Graphics 630",
};
DISPLAY_DEVICE device;
device.cb = sizeof(DISPLAY_DEVICE);
DWORD i = 0;
while (::EnumDisplayDevices(NULL, i++, &device, 0))
{
// skip non-primary device
if ((device.StateFlags & DISPLAY_DEVICE_PRIMARY_DEVICE) == 0)
continue;
// check for unsupported device
std::string deviceString(device.DeviceString);
for (auto&& item : blacklist)
{
if (deviceString.find(item) != std::string::npos)
{
QCoreApplication::setAttribute(Qt::AA_DisableShaderDiskCache, true);
return QStringLiteral("software");
}
}
}
return QStringLiteral("auto");
}

Are your graphics card drivers up-to-date? If not, it's possible that updating them would resolve these sorts of issues.

@DesiQuintans
Copy link
Author

@DesiQuintans DesiQuintans commented Mar 12, 2019

I'm not sure if I have the auth to update them, but I can have a look tomorrow.

I used RStudio all day today with the OpenGL renderer enabled and found that the blinking dot is not just limited to one document, but exists on the canvas of the editor or something, because it stays in the same place on the screen when I change to a different document, or even when I look at the data viewer.

It would be a shame to miss out on using this renderer because I get a big performance improvement with it on larger RMarkdown files.

@AshesITR
Copy link

@AshesITR AshesITR commented Mar 19, 2019

I can reproduce the issue on a GTX 1080Ti on Win7 x64 with driver version 419.35 (as of writing this, the most recent one).

@dicorynia
Copy link

@dicorynia dicorynia commented Apr 4, 2019

Hi.
Similar problem (RStudio v. 1.2.1327 on windows 7 64bit, Nvidia GTX960 v. 378.92). The blinking dot follows the cursor, in the console or the editor.
No blinking dot if I switch to software rendering in the RStugio options.

Thanks

@lz1nwm
Copy link

@lz1nwm lz1nwm commented Apr 10, 2019

Just to confirm the bug with the cursor - RStudio v. 1.2.1335 on Win7 64bit, Radeon 7350. No blinking dot if I switch to software rendering, as well.

@FluffierThanThou
Copy link

@FluffierThanThou FluffierThanThou commented May 22, 2019

As reported in #4822, I have the same problem with RStudio 1.2.1335, Win10 Enterprise 1703 (x64) and an Intel HD 4600 integrated graphics chip using (fairly) recent drivers. The dot only appears when using OpenGL rendering.

@brupelo
Copy link

@brupelo brupelo commented May 29, 2019

Hello guys, this bug has been reported for a while at https://bugreports.qt.io/browse/QTBUG-74492. So if you've got new info/insights that could help Qt developers to narrow it down, please report there. Really annoying and nasty this bug... We've already provided couple of mcves there though.

Thanks.

@Spaak
Copy link

@Spaak Spaak commented Jul 31, 2019

I'm having the same issue on RStudio 1.2.1335, Windows 10 Enterprise 2016 LTSB 10.0.14393 Build 14393 (x64). Graphics card is an NVIDIA Quadro K600, driver version 369.39 (DirectX 12).

As described above, the issue does not occur when I select software rendering.

@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Jul 31, 2019

Evidently, this issue will be fixed in the next version of Qt (5.12.5) but it feels frightening to take yet another Qt update in this release cycle.

@jmcphers do you think it's worth taking an update for this bug, or deferring for v1.3, or something else?

@jmcphers
Copy link
Member

@jmcphers jmcphers commented Jul 31, 2019

I don't think we should patch 1.2 for this. Very few people are affected (apologies to those in this thread who are!) and historically Qt 5.12 updates have been very disruptive as they are prone to changing not only functionality but dependencies in their point releases. :-/ We should take a Qt update for 1.3 instead.

@JeffreyBlumenthal
Copy link

@JeffreyBlumenthal JeffreyBlumenthal commented Dec 11, 2019

I fixed this problem by toggling Rendering Engine to "Software", (Tools -> Global ->General [Advanced tab] per this:

https://support.rstudio.com/hc/en-us/articles/360017886674-Troubleshooting-RStudio-Rendering-Errors

This was on Windows 7, R 3.6.1, R Studio 1.2.5001

@ghost
Copy link

@ghost ghost commented Dec 11, 2019

After a lot of effort we'd fixed this issue a while ago. For more info just check https://bugreports.qt.io/browse/QTBUG-74492 . In case you want a proper fix you'll just need to upgrade this repo to use the proper version of Qt.

@stale
Copy link

@stale stale bot commented Feb 5, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

@stale stale bot added the stale label Feb 5, 2021
@stale stale bot removed the stale label Feb 10, 2021
@jmcphers jmcphers added electron stale labels Feb 10, 2021
@stale stale bot removed the stale label Feb 10, 2021
@jmcphers jmcphers added this to the v1.5 milestone Feb 10, 2021
@mikebessuille mikebessuille modified the milestones: 1.5 (Q3 2021), Electron Apr 14, 2021
@kevinushey
Copy link
Contributor

@kevinushey kevinushey commented Mar 2, 2022

Presumedly this issue is fixed already given that we've updated to Qt 5.12.8 on Windows; I'm going to close as fixed but please re-open if you see it again.

(I also doubt we'll see it in the Electron port.)

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

No branches or pull requests