pkulchenko / ZeroBraneStudio

Lightweight Lua-based IDE for Lua with code completion, syntax highlighting, live coding, remote debugger, and code analyzer; supports Lua 5.1, 5.2, 5.3, 5.4, LuaJIT and other Lua interpreters on Windows, macOS, and Linux
http://studio.zerobrane.com/
Other
2.62k stars 518 forks source link

Flickering issue near text prompt on Kubuntu #1043

Closed renatoathaydes closed 4 years ago

renatoathaydes commented 4 years ago

Hi, I have been trying ZeroBrane Studio and I like it so far. Except for the fact that, near the blinking text cursor, the UI graphics flickers a lot, making it pretty much un-usable for me.

I noticed this both on the main source code window and on the Console as well. There seems to be no flickering when the blinking cursor is not visible anywhere.

I am using Ubuntu 19.10 eoan with KDE Plasma.

Video demonstrating the issue (the video managed to capture the problem, but it's much worse in real life): https://www.youtube.com/watch?v=Csd6w5LPG_Y&feature=youtu.be

pkulchenko commented 4 years ago

@renatoathaydes, thank you for the report. I do see the effect in the video. I can't tell you what may be contributing to this and I haven't see it happening anywhere; can you try the following:

  1. Open the IDE and run the following command in the console: ide:GetEditor():GetBufferedDraw()
  2. Post the output here (true/false)
  3. If the result is false, then run the following command: ide:GetEditor():SetBufferedDraw(true)
  4. Check the editor to see if the effect still happens.

There was a recent change that turned the buffering off, as it was no longer needed and was causing some unwanted effects (aee8effc), but it could have affected some systems.

pkulchenko commented 4 years ago

Note that after running the suggested command the "fix" (if any) will only be applied to the currently selected editor tab.

renatoathaydes commented 4 years ago

ide:GetEditor():GetBufferedDraw() outputs false.

After setting that to true, no change could be observed on the console (it was flickering together with the cursor, approximately, both before and after running the command).

I have to say that the main editor was not flickering (before/after the change) until I started my Love app... but it continues to flicker after I stop it.

pkulchenko commented 4 years ago

After setting that to true, no change could be observed on the console (it was flickering together with the cursor, approximately, both before and after running the command).

Right, it would not affect the console, only the current editor.

I have to say that the main editor was not flickering (before/after the change) until I started my Love app... but it continues to flicker after I stop it.

Does this mean that it did fix the current editor? Can you try running the same command again (ide:GetEditor():SetBufferedDraw(true)) after you stop the Love app? If it doesn't help, try running it with false and then with true.

renatoathaydes commented 4 years ago

I've just restarted the app, and now it was just flickering from the start.

After I ran ide:GetEditor():SetBufferedDraw(true) it actually stopped flickering!

I then set it to false and the flickering came back. So I now think you're right that this seems to be causing the issue... not sure though, as in my previous try it did not seem to have fixed it.

The console seems to continue flickering in all cases, which is what you probably referred to when you said it would not affect the console.

Does this mean that it did fix the current editor?

Just to answer that: no. What I had said was that the flickering seemed to have started only after I ran my app... but that command did not affect anything then.

pkulchenko commented 4 years ago

@renatoathaydes, ok, try the following plugin:

package {
  onEditorNew = function(self, editor) editor:SetBufferedDraw(true) end,
  onEditorLoad = function(self, editor) editor:SetBufferedDraw(true) end,
  onRegister = function() ide:GetOutput():SetBufferedDraw(true); ide:GetConsole():SetBufferedDraw(true) end,
}

You can add this code to the configuration file (user.lua) and restart the IDE.

pkulchenko commented 4 years ago

@renatoathaydes, let me know if you had a chance to test it and the suggested configuration fixes the issue.

pkulchenko commented 4 years ago

@renatoathaydes, closing the ticket. Feel free to update/reopen the ticket if the fix didn't work for you. Thanks!