This is Bugzilla
View Bug Activity | Format For Printing | XML | Clone This Bug
Document body is redrawn constantly as soon as it is not empty. Causes fast flashing cursor, slow response, power consumption, and increased fan speed. Workaround is to change to a different Gtk theme. Related bugs: Ubuntu 16.04. https://bugs.launchpad.net/ubuntu/+source/abiword/+bug/1574278 Fedora 23 and Fedora 24. https://bugzilla.redhat.com/show_bug.cgi?id=1287835 Sugar Write activity. https://bugs.sugarlabs.org/ticket/4915
I have never seen the problem on Fedora (from 14 to 24) with Intel GPU. Nor do I see it on this machine that uses Nouveau with Fedora 24. Default Gnome theme. Not sure how you go about reproducing it.
bug 13779 is a dupe.
*** Bug 13786 has been marked as a duplicate of this bug. ***
*** Bug 13779 has been marked as a duplicate of this bug. ***
I can easily reproduce on Ubuntu 16.04 with VirtualBox or real hardware with an Intel GPU, and yes, it does seem to relate to the theme. If your hardware is particularly fast, you might not notice it. To test for that possibility, run % abiword --gtk-debug=updates For me, the screen goes red as soon as I type something. Gtk+ source reference: https://git.gnome.org/browse/gtk+/tree/gdk/gdkwindow.c?h=3.18.7#n4496
(In reply to comment #5) > I can easily reproduce on Ubuntu 16.04 with VirtualBox or real hardware with an > Intel GPU, and yes, it does seem to relate to the theme. > > If your hardware is particularly fast, you might not notice it. To test for > that possibility, run Define "fast". This is an 6 years old laptop. Sadly using nouveau instead of Intel GPU though. Slower than what I had before that ran an Intel GPU.
--gtk-debug=updates should do the trick. We are definitely abusing something.
Agreed, fast is hard to define. I should have said; some configurations are fast enough that the problem is nearly invisible. On those configurations, the problem may be represented by an increased text cursor blink rate after the transition from empty to non-empty document. Good to hear --gtk-debug=updates is usable for reproducing.
(In reply to comment #8) > Good to hear --gtk-debug=updates > is usable for reproducing. Reproducing is not exactly the word, but I can definitely visualize excessive redraws and I should be able to improve the situation in the hope that someone can test.
I don't see the excessive redrawing here eiher. Which window manager do you use and which theme? Also which version of Gtk3. I know that I already have a more recent version than Ubuntu 16.04 LTS which is already baffling since it was release before.
Thanks for testing. Others have reproduced this problem in different ways, on the related bug reports. My first method to reproduce is to boot the Ubuntu 16.04 amd64 ISO in VirtualBox or on affected hardware, add universe repository, install abiword, and then run it. Everything fine until first key typed. Problem occurs without --gtk-debug=updates, and adding the option causes constant red widget. In this configuration, the window manager is compiz 0.9.12.2, gtk is 3.18.9, the theme is the default Ambiance. Switching to High Contrast theme is a workaround. My second method to reproduce is to install Ubuntu 16.04 amd64 ISO in VirtualBox or on affected hardware, add universe repository, install abiword, Sugar, and the Sugar Write Activity from OLPC package archive, and then run Write. In this configuration, the window manager is metacity 3.18.4, gtk is 3.18.9, and the theme is not under user control. What version of gtk do you not reproduce with? I see Ubuntu has not gone beyond 3.18.9 yet. Debian has 3.20.6 in testing, so I'll give that a spin to see if it fixes. Local package build in progress.
> Debian has 3.20.6 in testing, so I'll give that a spin I take that back. Gtk+3.0 source package 3.20.6-2 doesn't build on Ubuntu 16.04, and I wasn't able to figure out why, sorry.
This problem happened for me with Lubuntu 16.04. I read somewhere (don't remember where) that this can be circumvented by changing the appearance preferences of the LXDE desktop: you should change your options to anything but options called lubuntu-*. I did it like that: - interface tab: changed to "Mist" option - icons themes tab: changed to "Humanity" option - Windows borders tab: changed to "Mikachu" option It gives me a nice desktop appearance and... miracle... Abiword doesn't flicker anymore Hope this helps
FWIW, I can't reproduce on Fedora 24 using the following Python code: ```` #!/usr/bin/python3 import gi gi.require_version('Abi', '3.0') from gi.repository import Abi gi.require_version('Gtk', '3.0') from gi.repository import Gtk def __draw_cb(widget, cr): print('__draw_cb cr=%r' % cr.copy_clip_rectangle_list()) win = Gtk.Window(title="PyAbiword") Abi.init([]) widget = Abi.Widget() widget.connect('draw', __draw_cb) win.add(widget) win.connect("delete-event", Gtk.main_quit) win.show_all() Gtk.main() ````
Fedora 24 with Gnome 3 I mean.
Thanks for the code. The code does reproduce for me on Ubuntu 16.04 (Gtk+ 3.18.9); the __draw_cb becomes continuous as soon as a key is typed. The code does not reproduce for me on Fedora 24 (Gtk+ 3.20.6), Debian Jessie/Stable (Gtk+ 3.14.5), or Debian Stretch/Testing (Gtk+ 3.20.6). Upgrading Gtk+ seems a likely fix, and I'm still looking into how to do that. Let me know if you want more detailed instructions for reproducing on Ubuntu 16.04.
What if you build upstream Gtk 3.18.9 on Ubuntu and use that? Is it using Unity or plain Gnome.....
On Ubuntu 16.04 local builds were made of Debian packages wayland_1.11.0-2, gtk+2.0_2.24.30-4, gtk+3.0_3.20.6-2 and adwaita-icon-theme_3.20-3 then installed. No other changes were made. The symptom is fixed with your reproducer, and the Sugar Write activity. There are no spurious __draw_cb calls made. My guess is a Gtk+ bug was triggered by Abiword 3.0.1. For the moment I'm fine with upgrading these packages as a solution. Closing the bug as invalid - not Abiword. Thanks for your time!
found a way to reproduce
*** Bug 13804 has been marked as a duplicate of this bug. ***
I can reproduce by launching Xnest, running AbiWord in Xnest (and I run Wayland)
I had this bug on another laptop whith intel HD graphics (bug 13779) Now whith the same system and theme(graybird) but on intel HD3000 graphics I have no any problem
It doesn't happen with trunk, btw.
I'm convinced this is because of the caret code. The same one that doesn't work on Wayland... or even MacOS X.
What's the caret code? Good to hear you've been able to reproduce. It can be reproduced easily using Ubuntu 16.04 ISOs run under VirtualBox.
(In reply to comment #25) > What's the caret code? This: https://github.com/AbiWord/abiword/blob/trunk/src/af/gr/xp/gr_Caret.cpp Which doesn't work on Wayland either.
Just would like to confirm that I have the same problem with abiword-3.0.2 on a homegrown Linux based on GTK3. Upgrading to the latest gtk+-3.22.1 did not help. (Except that the screen now seems to flicker in black instead of white.) I'm back to SVN version 35248 which works fine for me. Best regards, Erik
See also bug 13815 for the "black flicker"
I run 'abiword': link-grammar: Info: Dictionary found at /usr/share/link-grammar/en/4.0.dict link-grammar: Error: Aspell: No word lists can be found for the language "en". link-grammar: Info: Spell checker disabled. Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
*** Bug 13822 has been marked as a duplicate of this bug. ***
*** Bug 13824 has been marked as a duplicate of this bug. ***
*** Bug 13825 has been marked as a duplicate of this bug. ***
*** Bug 13829 has been marked as a duplicate of this bug. ***
*** Bug 13837 has been marked as a duplicate of this bug. ***
Ping. Is there any chance to have this solved soon? This is a major issue for Gentoo users, and we'd like to mark GTK+ 3.22 stable soon.
it is not specific to Gtk 3.22.
(In reply to comment #36) > it is not specific to Gtk 3.22. Really? I didn't notice it before the black view issue, and after applying the patch for that AbiWord becomes uselessly unresponsive. So if it isn't recent, then it must've gotten worse with that fix (to the point of me not backporting it).
Ubuntu 16.04 mentionned in comment #0 ship with Gtk 3.18. So does Fedora 23. Fedore 24 ship with 3.20. So yeah. And I have never been able to reproduce it outside of Xnest (run within Wayland). It is a combination of badly written code on AbiWord and Gtk+ changes.
Created an attachment (id=5839) [details] Proposed patch This is the proposed patch. Given the circumstance under which I can reproduce, unlike reporters, I'd like to get more feedback and see if that effectively fix the issue. This change bring things back in line with trunk on Gtk3.
It doesn't seem to change anything for me. The cursor is still flickering, and there's around 3 s delay between keypress and text showing up.
I havent tried the patches. All i can say is that i have this also on Mageia 6 (Cauldron) https://www.youtube.com/watch?v=4XolRGsDux0&feature=youtu.be
(In reply to comment #24) > I'm convinced this is because of the caret code. The same one that doesn't work > on Wayland... or even MacOS X. > I had problems with the caret code, specifically, m_pG->flush(), which leads to gtk_widget_queue_draw(m_Widget), added for Wayland I think? GR_Caret::_blink was being called too often, the CPU usage shot up and the caret disappeared. I commented out m_pG->flush() and all was fine. Maybe something similar to below might help? #ifdef GDK_WINDOWING_WAYLAND if (GDK_IS_WAYLAND_DISPLAY(gtk_widget_get_display(gdk_display_get_default()))) { m_pG->flush(); } #endif For Wayland this would also need #ifdef GDK_WINDOWING_WAYLAND #include <gdk/gdkwayland.h> #endif for GDK_IS_WAYLAND_DISPLAY
(In reply to comment #39) > Created an attachment (id=5839) [details] [details] > Proposed patch > > This is the proposed patch. Given the circumstance under which I can reproduce, > unlike reporters, I'd like to get more feedback and see if that effectively fix > the issue. > > This change bring things back in line with trunk on Gtk3. > The patch worked for me. The flickering cursor is now a solid vertical blinking line (no screen flicker). My system is a Dell 980, Nvidia GeForceGT680, video driver NVIDIA-Linux-x86_64-367.27.run, Slackware 14.2 x86_64, gtk+3-3.18.9-x86_64-1. Would be nice if the cursor did not turn off after 11 seconds. Double-clicking "Bold" (or 2x CTRL-B) brings the cursor back without too much inconvenience.
*** Bug 13860 has been marked as a duplicate of this bug. ***
Sorry for the delay in responding. The patch worked for me to stop constant redraws of the document body, which otherwise begins happening as soon as an empty document is changed. Fast flashing cursor part of problem is changed, but mostly still the same; the caret blinks regularly in an empty document, and then flickers rapidly once the empty document is changed. Flickering stops after a short while. On the system, slow response, power consumption, and increased fan speed is not much changed, even after the caret stops flickering; CPU consumption fell from 100% of one core to 60%, mostly in Xorg. Test system is an N2940 Intel CPU, an OLPC laptop. By the way, reproducing the problem is easier with compositing off (e.g. metacity --no-composite); otherwise the expose and draw is handled by the compositor and doesn't reach the X server or hardware. Reproduces for me on Debian Stretch, Ubuntu 16.04, 16.10, and 17.04, as well as Fedora 23, 24 and 25.. Workaround of using Adwaita theme works in Ubuntu 16.04, 16.10, but has stopped working in 17.04. Probably something about the theme changes the timing of a race condition.
*** Bug 13865 has been marked as a duplicate of this bug. ***
Fix for xubuntu: in a file /usr/share/applications/abiword.desktop change Exec=abiword %U to Exec=bash -c 'GTK_THEME=Adwaita abiword %U' It should work
Using Xubuntu 17.04 with Adwaita theme. Tried fix, problem unaffected.
(In reply to comment #49) > Using Xubuntu 17.04 with Adwaita theme. > > Tried fix, problem unaffected. > Just retry on another laptop with xubuntu 16.04.2 & intel HD -it works. Theme Greybird on both. PS: retry with Adwaita- fix still works PSS: first machine runs xubuntu 16.04.2 with intel HD3000
No problem on Xubuntu 16.04 or 16.10 - with or without the fix. Problem began with 17.04 and is quite severe.
(In reply to comment #51) > No problem on Xubuntu 16.04 or 16.10 - with or without the fix. Problem began > with 17.04 and is quite severe. > I had this bug on two laptops with 16.04, my bug-report was https://bugzilla.abisource.com/show_bug.cgi?id=13779 and it`s marked like a dub of this one
> I had this bug on two laptops with 16.04, my bug-report was No disagreement, just different results. I see no problem with 16.04, but 17.04 is almost unusable - with or without the fix. Hope this helps!
*** Bug 13866 has been marked as a duplicate of this bug. ***
*** Bug 13872 has been marked as a duplicate of this bug. ***
*** Bug 13874 has been marked as a duplicate of this bug. ***
*** Bug 13875 has been marked as a duplicate of this bug. ***
Created an attachment (id=5860) [details] Fix flickering Hey Hubert, please review attached patch. Fixes the problems for me. Briefly, GR_Caret::_blink calls GR_UnixCairoGraphics::flush which generates redundant draw events which are passed to XAP_UnixFrameImpl::_fe::expose.
*** Bug 13876 has been marked as a duplicate of this bug. ***
This patch doesn't apply on the 3.0.0 branch. Nor trunk.
Yes, that's right. Are you going to not review it because you can't apply it?
(From update of attachment 5860 [details]) >diff --git a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp >index 509bd37..7c3c06f 100644 >--- a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp >+++ b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp >@@ -577,9 +577,7 @@ void GR_UnixCairoGraphics::_endPaint() > > void GR_UnixCairoGraphics::flush(void) > { >- if (m_Widget) { >- gtk_widget_queue_draw(m_Widget); >- } >+ gdk_flush(); > } This change break the redraw, at least on Wayland. We want to invalidate to cause a redraw.
Thanks for the review. AbiWord is coded to invalidate and redraw in response to caret blinking and the 10ms timer. The flicker correlates to the timer value. Wayland is not one of my targets, and I'm happy with the fix on X11, and will package that for OLPC. I'll withdraw involvement now.
*** Bug 13879 has been marked as a duplicate of this bug. ***
Ok but, I am a noob. How do I apply the patch to fix the problem? I have no idea. How do I patch Abiword in Lubuntu?
there is currently no fix.