After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 644351 - Gimp misses some strokes especially when drawing fast
Gimp misses some strokes especially when drawing fast
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
2.6.11
Other Linux
: Normal major
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 649085 649204 654322 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-09 21:52 UTC by Šarūnas Valaškevičius
Modified: 2013-06-23 17:20 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Šarūnas Valaškevičius 2011-03-09 21:52:58 UTC
(marked version 2.6, but the problem exists in git master too)

as I *guess*, gimp registers input events in a gueue and draws them later, the problem is for slower brushes or when drawing fast (or especially the combination :D) - after buffer (queue) is filled up, gimp stops listening for new events (maybe it stops listening while drawing still repainting?). Not sure if this is really the internal workings of gimp, but it describes the problem best.

also see this link as I entered bug there 1st: https://bugs.launchpad.net/ubuntu/+source/gimp/+bug/731088

Marked as severity "major", because it makes work with tablet unusable.

the warnings I got after strokes where missing:
--------------------------
This is a development version of GIMP. Debug messages may appear here.

(gimp-2.7:13413): GLib-GObject-WARNING **: value "-2147483648" of type `gint' is invalid or out of range for property `cache-size' of type `gint'

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_keyboard_ungrab: assertion `shell->keyboard_grabbed == TRUE' failed

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_pointer_ungrab: assertion `shell->pointer_grabbed == TRUE' failed

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_keyboard_ungrab: assertion `shell->keyboard_grabbed == TRUE' failed

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_pointer_ungrab: assertion `shell->pointer_grabbed == TRUE' failed

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_keyboard_ungrab: assertion `shell->keyboard_grabbed == TRUE' failed

(gimp-2.7:13413): Gimp-Display-CRITICAL **: gimp_display_shell_pointer_ungrab: assertion `shell->pointer_grabbed == TRUE' failed

--------------------------
Comment 1 Michael Natterer 2011-03-10 16:44:14 UTC
The warnings in master were only there one day or so, and are fixed now.
Comment 2 Michael Natterer 2011-03-10 22:11:00 UTC
Scratch that last statmeent, I see the warnings too.
Comment 3 Michael Natterer 2011-03-10 23:48:13 UTC
It seems that when we miss a stroke, we miss the *entire* stroke,
not just some events. Sprinkling some debug printf in
gimp_display_shell_tool_events() shows that we never get a
BUTTON_PRESS event for the missing strokes, and it only seems
to happen under heavy painting load with a large brush on a
large image. Also, it's not related to the tablet, just easier
to trigger than with the mouse.

Whatever is fishy here, I don't see where we could possibly do
something that would block button press events, I suspect they
get lost somewhere inside GTK+.

(Changing bug title, because tablet painting slowness
is tracked in another bug).
Comment 4 Michael Natterer 2011-03-11 00:21:11 UTC
The gtk3-port branch also seems to miss strokes, but doesn't warn
whatsoever, so I guess the events are "at least" swallowed consistently
in GTK+ 3.x (button press *and* button release).
Comment 5 Alexia Death 2011-05-09 12:25:53 UTC
*** Bug 649204 has been marked as a duplicate of this bug. ***
Comment 6 Alexia Death 2011-05-09 12:26:28 UTC
*** Bug 649085 has been marked as a duplicate of this bug. ***
Comment 7 Ben Simonds 2011-05-17 17:07:03 UTC
I originaly submitted bug 64085, but as it's been marked as a duplicate of this bug I'll post here.

I've just been messing around, and noticed that turning on the "KDE/Qt event loop" setting in the CompizConfig settings manager vastly improves performance with my tablet, both in Gimp 2.6.11 and 2.7.3. Before only about 60 to 70% of strokes would register when painting quickly, now it's pretty much rock solid.

I'm a bit of a non-technical user, so I'm not sure if that's relevant/not something I should have submitted in the first place. Anyway, hope it's useful.
Comment 8 Dave 2011-06-01 18:12:46 UTC
Well I'm suffering this in Ubuntu 11.04 on both an old and a newly built PC that's has an Intel I5 2500k CPU with 8Gb memory so I can't believe it can be  performance related. I tried the KDE/Qt event setting suggestion and I can't say it made any difference for me.
Comment 9 Michael Natterer 2011-12-09 19:37:54 UTC
Fixed in master:

commit 01f92a3b486bbc2b8aac1771e613e07cb36d7f43
Author: Michael Natterer <mitch@gimp.org>
Date:   Fri Dec 9 20:20:02 2011 +0100

    app: get rid of server grabs for almost all canvas interaction
    
    Because it's generally the right thing to do, and server grabs broke
    badly with input devices / client side windows.
    
    gimpdisplayshell-grab.c: change logic to only server-grab if an event
    is passed to the pointer grab/ungrab functions, but always use
    gtk_grab_add/remove() which is sufficient in most cases.
    
    gimpdisplayshell-tool-events.c: have the grab functions grab the
    server only for space-bar scrolling and do all tool interaction,
    including ruler clicks, with gtk_grab_add/remove(). Refactor things
    a bit to also use the grab API for button-2 scrolling.
    
    gimpdeviceinfo-coords.c: transform the event's coords to the canvas'
    coordinate system, they might come from a ruler now.
    
    This fixes the following bugs:
    
    Bug 645315 - gimp_display_shell_pointer_grab: gdk_pointer_grab failed...
    Bug 644351 - Gimp misses some strokes especially when drawing fast
    Bug 645747 - Gimp is now unusable on xfce4

 app/display/gimpdisplayshell-grab.c        |   84 +++++++++++++---------------
 app/display/gimpdisplayshell-tool-events.c |   80 ++++++++++++---------------
 app/display/gimpdisplayshell.h             |    2 +
 app/widgets/gimpdeviceinfo-coords.c        |   25 ++++++++
 4 files changed, 100 insertions(+), 91 deletions(-)
Comment 10 Michael Natterer 2013-06-23 17:20:11 UTC
*** Bug 654322 has been marked as a duplicate of this bug. ***