First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 13791
Product:
Component:
Status: ASSIGNED
Resolution:
Assigned To: Hubert Figuière <hfiguiere@teaser.fr>
Hardware:
OS:
Version:
Priority:
Severity:
Target Milestone:
Reporter: James Cameron <quozl@laptop.org>
Add CC:
CC:
Remove selected CCs
QA Contact:
URL:
Summary:
Status Whiteboard:
Keywords:

Attachment Type Creator Created Size Flags Actions
Proposed patch patch Hubert Figuière 2016-12-22 05:31 2.07 KB none Details | Diff
Fix flickering patch James Cameron 2017-08-17 07:19 5.53 KB hfiguiere: fail+
Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 13791 depends on: Show dependency tree
Show dependency graph
Bug 13791 blocks: 13566

Additional Comments:








View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2016-07-07 02:06
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

------- Comment #1 From Hubert Figuière 2016-07-07 03:29:51 -------
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.

------- Comment #2 From Hubert Figuière 2016-07-07 03:30:09 -------
bug 13779 is a dupe.

------- Comment #3 From Hubert Figuière 2016-07-07 03:43:54 -------
*** Bug 13786 has been marked as a duplicate of this bug. ***

------- Comment #4 From Hubert Figuière 2016-07-07 03:44:07 -------
*** Bug 13779 has been marked as a duplicate of this bug. ***

------- Comment #5 From James Cameron 2016-07-07 04:16:53 -------
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

------- Comment #6 From Hubert Figuière 2016-07-07 04:33:39 -------
(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.

------- Comment #7 From Hubert Figuière 2016-07-07 04:41:10 -------
 --gtk-debug=updates should do the trick. We are definitely abusing something.

------- Comment #8 From James Cameron 2016-07-07 05:18:03 -------
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.

------- Comment #9 From Hubert Figuière 2016-07-07 15:13:59 -------
(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.

------- Comment #10 From Hubert Figuière 2016-07-08 14:04:25 -------
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.

------- Comment #11 From James Cameron 2016-07-09 01:15:32 -------
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.

------- Comment #12 From James Cameron 2016-07-09 05:14:21 -------
> 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.

------- Comment #13 From Jacques Beckand 2016-07-11 10:33:05 -------
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

------- Comment #14 From Hubert Figuière 2016-07-26 03:45:06 -------
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()
````

------- Comment #15 From Hubert Figuière 2016-07-26 03:46:13 -------
Fedora 24 with Gnome 3 I mean.

------- Comment #16 From James Cameron 2016-07-26 05:07:04 -------
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.

------- Comment #17 From Hubert Figuière 2016-07-26 15:23:10 -------
What if you build upstream Gtk 3.18.9 on Ubuntu and use that? Is it using Unity
or plain Gnome.....

------- Comment #18 From James Cameron 2016-08-02 13:40:34 -------
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!

------- Comment #19 From Hubert Figuière 2016-10-15 18:05:59 -------
found a way to reproduce

------- Comment #20 From Hubert Figuière 2016-10-15 18:06:34 -------
*** Bug 13804 has been marked as a duplicate of this bug. ***

------- Comment #21 From Hubert Figuière 2016-10-15 18:07:35 -------
I can reproduce by launching Xnest, running AbiWord in Xnest (and I run
Wayland)

------- Comment #22 From Ivan 2016-10-16 00:19:33 -------
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

------- Comment #23 From Hubert Figuière 2016-10-16 03:53:57 -------
It doesn't happen with trunk, btw.

------- Comment #24 From Hubert Figuière 2016-10-16 23:18:17 -------
I'm convinced this is because of the caret code. The same one that doesn't work
on Wayland... or even MacOS X.

------- Comment #25 From James Cameron 2016-10-17 06:10:23 -------
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.

------- Comment #26 From Hubert Figuière 2016-10-17 06:36:24 -------
(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.

------- Comment #27 From Erik Heinz 2016-10-23 22:02:24 -------
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

------- Comment #28 From Hubert Figuière 2016-10-24 00:15:51 -------
See also bug 13815 for the "black flicker"

------- Comment #29 From Alejandro 2016-10-28 20:16:39 -------
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.

------- Comment #30 From Alejandro 2016-10-28 20:17:36 -------
*** Bug 13822 has been marked as a duplicate of this bug. ***

------- Comment #31 From Hubert Figuière 2016-11-08 16:01:44 -------
*** Bug 13824 has been marked as a duplicate of this bug. ***

------- Comment #32 From Hubert Figuière 2016-11-11 02:55:10 -------
*** Bug 13825 has been marked as a duplicate of this bug. ***

------- Comment #33 From Hubert Figuière 2016-11-15 04:25:19 -------
*** Bug 13829 has been marked as a duplicate of this bug. ***

------- Comment #34 From Hubert Figuière 2016-12-11 01:27:12 -------
*** Bug 13837 has been marked as a duplicate of this bug. ***

------- Comment #35 From Michał Górny 2016-12-15 15:41:47 -------
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.

------- Comment #36 From Hubert Figuière 2016-12-15 22:39:40 -------
it is not specific to Gtk 3.22.

------- Comment #37 From Michał Górny 2016-12-15 23:52:48 -------
(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).

------- Comment #38 From Hubert Figuière 2016-12-16 00:06:25 -------
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.

------- Comment #39 From Hubert Figuière 2016-12-22 05:31:49 -------
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.

------- Comment #40 From Michał Górny 2016-12-22 13:40:39 -------
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.

------- Comment #41 From psyca 2017-01-24 00:50:11 -------
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

------- Comment #42 From Craig McPartland 2017-04-02 18:36:27 -------
(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

------- Comment #43 From Norm Leet 2017-04-21 15:33:07 -------
(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.

------- Comment #44 From Hubert Figuière 2017-04-24 06:03:44 -------
*** Bug 13860 has been marked as a duplicate of this bug. ***

------- Comment #45 From Hubert Figuière 2017-04-24 19:07:37 -------
*** Bug 13860 has been marked as a duplicate of this bug. ***

------- Comment #46 From James Cameron 2017-04-26 05:37:27 -------
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.

------- Comment #47 From Hubert Figuière 2017-06-07 01:41:35 -------
*** Bug 13865 has been marked as a duplicate of this bug. ***

------- Comment #48 From Ivan 2017-06-10 21:10:42 -------
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

------- Comment #49 From abiword-bugzilla-ok@oo.net 2017-06-11 01:21:29 -------
Using Xubuntu 17.04 with Adwaita theme.

Tried fix, problem unaffected.

------- Comment #50 From Ivan 2017-06-11 16:10:04 -------
(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

------- Comment #51 From abiword-bugzilla-ok@oo.net 2017-06-11 20:47:53 -------
No problem on Xubuntu 16.04 or 16.10 - with or without the fix. Problem began
with 17.04 and is quite severe.

------- Comment #52 From Ivan 2017-06-11 23:28:13 -------
(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

------- Comment #53 From abiword-bugzilla-ok@oo.net 2017-06-12 04:02:15 -------
> 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!

------- Comment #54 From Hubert Figuière 2017-06-13 22:30:23 -------
*** Bug 13866 has been marked as a duplicate of this bug. ***

------- Comment #55 From Hubert Figuière 2017-07-29 02:34:57 -------
*** Bug 13872 has been marked as a duplicate of this bug. ***

------- Comment #56 From Hubert Figuière 2017-08-15 05:19:30 -------
*** Bug 13874 has been marked as a duplicate of this bug. ***

------- Comment #57 From Hubert Figuière 2017-08-16 04:24:50 -------
*** Bug 13875 has been marked as a duplicate of this bug. ***

------- Comment #58 From James Cameron 2017-08-17 07:19:42 -------
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.

------- Comment #59 From Hubert Figuière 2017-08-23 17:54:58 -------
*** Bug 13876 has been marked as a duplicate of this bug. ***

------- Comment #60 From Hubert Figuière 2017-09-01 04:37:17 -------
This patch doesn't apply on the 3.0.0 branch. Nor trunk.

------- Comment #61 From James Cameron 2017-09-01 05:31:48 -------
Yes, that's right.  Are you going to not review it because you can't apply it?

------- Comment #62 From Hubert Figuière 2017-09-01 05:44:26 -------
(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.

------- Comment #63 From James Cameron 2017-09-01 07:43:49 -------
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.

------- Comment #64 From Hubert Figuière 2017-09-09 16:29:18 -------
*** Bug 13879 has been marked as a duplicate of this bug. ***

------- Comment #65 From Luca Nieddu 2017-09-09 20:50:44 -------
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?

------- Comment #66 From Hubert Figuière 2017-09-10 04:56:59 -------
there is currently no fix.

First Last Prev Next    No search results available      Search page      Enter new bug