mate-desktop / pluma

A powerful text editor for MATE
http://www.mate-desktop.org
GNU General Public License v2.0
156 stars 64 forks source link

Pluma textview flashing when wrap-mode='GTK_WRAP_WORD' #282

Open ghostplant opened 6 years ago

ghostplant commented 6 years ago

Expected behaviour

No screen flash when mouse moves or selects documents within textview.

Actual behaviour

If there is no even 1 line that "overflows" the right bound of the pluma window (typically, set wrap-mode='GTK_WRAP_WORD' will make this condition satisifed), mouse selecting multi-line documents within textview will make the screen sharply flash which is extremely not comfortable for eyes.

Steps to reproduce the behaviour

1) install pluma 1.20.0 2) open pluma and set wrap-mode='GTK_WRAP_WORD' by disallowing word-wrap for text lines. 3) paste multi-line text documents. 4) move the mouse when it keeps selecting multi-line text.

MATE general version

1.20.0

Package version

1.20.0

Linux Distribution

Ubuntu 18.04 amd64

Link to downstream report of your Distribution

http://archive.ubuntu.com/ubuntu/pool/universe/p/pluma/pluma_1.20.0.orig.tar.xz

ghostplant commented 6 years ago

In addition, choosing 'Oblivion' style will double the screen-flashing effect.

lukefromdc commented 6 years ago

I was just unable to duplicate this, running Pluma from git master (just a few commits after 1.20 release) on Debian Unstable. GTK theme is my own "UbuntuStudio_Legacy" theme, and I have locally built GTK 3.22.27 and glib 2.55.2 installed.

ghostplant commented 6 years ago

@lukefromdc

I found 2 more symptoms: 1) Pluma textview screen-flashing issue doesn't happen when it runs in Virtualbox, it only happens in OS installed on physical hosts. Both NVidia video-card and Intel video card have this problem; 2) Make sure the text in pluma doesn't "overflow" not only to right bound but also to bottom bound, which means this issue only happen when you can see neither vertical scrollbar nor horizontal scrollbar.

ghostplant commented 6 years ago

So I think this is not related to wrap-mode='GTK_WRAP_WORD' but no-visible-scrollbar will cause the screen flash.

When I turn wrap-mode='GTK_WRAP_WORD' while the text is vertically long enough to produce the vertical scrollbar, I can also see flashing disappears.

lukefromdc commented 6 years ago

With words wrapping and no scrollbars I still don't get the flashes. While I don't have any virtual machines, I am on AMD and AMD graphics. I don't own any late-model Intel hardware and haven't used Nvidia for years due to the proprietary driver issue. Are you on Nvidia or Nouveau? Also are you on marco with or without compositing, or on compiz 0.9, or compiz-reloaded, or something else like marco+compton?

Since Pluma does not itself use the GPU at all, wonder if some kind of race condition (timing slower on virtual machines, maybe on my setup too) is involved?

ghostplant commented 6 years ago

I uses marco as window manager, and I JUST found that if I am using marco with composite manager enabled, there is no longer screen flashing. However, I prefer marco without composite manager since it is fast (via marco --no-composite --replace), and under this mode there is sharply flashing for pluma textview.

dddux commented 6 years ago

I noticed that it flashes when you open a file that doesn't cross the downward boundary, that is - when there is no scrollbar on the right. When there's a scrollbar, everything looks fine. So Pluma doesn't like not having a scrollbar in my case. I use a Nvidia VGA with the Debian legacy 340x driver. Pluma 1.18.3 from Debian Stretch backports.

lukefromdc commented 6 years ago

I still cannot duplicate this at all, wonder if themes affect it?

ghostplant commented 6 years ago

this issue happens on partial video cards only, i suggest to show the vertical bar always to fix it

Mno-hime commented 6 years ago

I noticed the very same problem when ported MATE 1.20, Pluma 1.20.2 to OpenIndiana (https://github.com/OpenIndiana/oi-userland/pull/4263). (The problem wasn't there with MATE 1.18, Pluma 1.18.5.) I use GKT+ 3.22.30, glib2 2.57.1, marco 1.20.1, happens with Composition Manager both on and off. My system is Lenovo X220 with Sandy Bridge era Intel GFX, using intel drivers in Xorg and the illumos kernel. The problem goes away when "Enable text wrapping" is turned off.

Reproducer (as others already noted):

Are there some logs which might help you debug this?

BenSmyth commented 2 years ago

This seems only to occur when there's no vertical scroll.

Temporarily forcing a vertical scroll fixes, e.g., add more lines until vertical scroll is added, remove those lines.

Is there a way to force a vertical scrollbar to always appear?

(Can I test solutions without a reboot?)

lukefromdc commented 2 years ago

I still cannot duplicate this, with or without any scrollbars, with or without compositing on marco, or with compiz. Debian Unstable, AMDGPU graphics

BenSmyth commented 2 years ago

@lukefromdc Do you know how to force a vertical scrollbar to always appear?

As-is, Pluma is unusable for many.

ghostplant commented 2 years ago

@lukefromdc I can reproduce that on several low-end computers, but on new computers, maybe the refresh frequency of video acceleration is good, I no longer encounter this issue.

ghostplant commented 2 years ago

BTW, I have migrated to 22.04, I'm not sure whether mesa-driver is the root-cause which has been fixed after 18.04.

BenSmyth commented 2 years ago

@ghostplant I'm on a Lenovo Thinkpad X1, c. 2014, running Linux Mint 20.

lukefromdc commented 2 years ago

I do not know of any way to unconditionally force a vertical scrollbar