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 645315 - gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1 on painting and guides
gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1 on pai...
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
2.6.11
Other Linux
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 656436 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-03-20 17:34 UTC by Vince C.
Modified: 2011-12-11 17:17 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vince C. 2011-03-20 17:34:40 UTC
My desktop environment is Xfce but this bug has also been observed in Gnome ( http://forum.xfce.org/viewtopic.php?pid=20641 ).

When I click a ruler in GIMP to drag and place a guide, the mouse is captured (grabbed) and any click event seems eaten... until I switch to another application on another virtual desktop. Then the mouse grab is released but there's no guide. Now if Gimp is full-screen, I'm kinda screwed :D!

During the grab «alt-tab», for instance, is acting like just «tab» and all the key strokes are acting as GIMP shortcuts. If I leave an application on another virtual desktop, I'm safe: just click the application icon in the taskbar and I'm done.

The only way to place a guide so far is to use the measuring tool. I have tested Gentoo (my main distro) and Fedora 14. I have reported the problem here as well: http://forums.gentoo.org/viewtopic-t-869669-highlight-.html .
Comment 1 Michael Natterer 2011-03-22 07:21:44 UTC
Please paste the output of "gimp -v".
Comment 2 Vince C. 2011-03-22 08:27:19 UTC
Here it is:

~ $ gimp -v
GNU Image Manipulation Program version 2.6.11

using GEGL version 0.0.22 (compiled against version 0.0.22)
using GLib version 2.26.1 (compiled against version 2.26.1)
using GTK+ version 2.22.1 (compiled against version 2.22.1)
using Pango version 1.28.3 (compiled against version 1.28.3)
using Fontconfig version 2.8.0 (compiled against version 2.8.0)
Comment 3 Alexandre Prokoudine 2011-04-04 12:12:24 UTC
I was told by a user that the same happens on Fedora 12 with all updates as well.

On Gentoo GIMP from Git master reportedly does the same, but is more verbose and spits to console the following:

gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1

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

(gimp-2.7:18997): Gimp-Display-CRITICAL **: gimp_display_shell_pointer_ungrab: assertion `shell->pointer_grabbed == TRUE' failed
^[agimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1
Comment 4 Alexandre Prokoudine 2011-04-05 21:45:46 UTC
The same user adds that everything works fine when run from KDE or as (don't shout) root user :)
Comment 5 Alexandre G 2011-04-09 17:49:42 UTC
I also had this problem on my computer (Arch Linux/GIMP 2.6.11), with lots of differents WM.

I found out the problem was that "Virtual core XTEST pointer" was enabled in the extended Input Devices dialog. I don't know what it stands for, but disabling it make guides work fine \o/
Comment 6 Michael Natterer 2011-04-09 18:54:24 UTC
Hell yes! I just enabled it, and a lot of image window interaction just
breaks, including guides. Will simply hide that device, it's apparently
not only entirely useless for GIMP's purpose, it's also dangerous.
Comment 7 Vince C. 2011-04-09 22:18:42 UTC
(In reply to comment #5)
> I found out the problem was that "Virtual core XTEST pointer" was enabled in
> the extended Input Devices dialog. I don't know what it stands for, but
> disabling it make guides work fine \o/

I for one have core XTEST pointer disabled and I had it disabled even before I saw the problem. In short the problem still occurs while that "Virtual core XTEST pointer" is disabled on my side.
Comment 8 Michael Natterer 2011-04-12 12:59:23 UTC
Do you have any of the incarnations of the mouse enabled, like touchpad,
trackpoint, instead of just the virtual core pointer?
Comment 9 Vince C. 2011-04-12 14:42:22 UTC
(In reply to comment #8)
> Do you have any of the incarnations of the mouse enabled, like touchpad,
> trackpoint, instead of just the virtual core pointer?

I for one have a «SynPS/2 Synaptics Touchpad» and a «Logitech Trackball» (plus the XTEST pointer, of course) listed in the «Input devices» dialog. All three are disabled. Enabling the trackball doesn't change anything.
Comment 10 Michael Natterer 2011-04-12 14:45:20 UTC
Hmm, then I'm out of ideas. Could you perhaps try if you get the
same result with git master?
Comment 11 Vince C. 2011-04-12 14:56:59 UTC
(In reply to comment #10)
> Hmm, then I'm out of ideas. Could you perhaps try if you get the
> same result with git master?

Ooooh... playing with unstable stuff is evil on Gentoo ;) . Sure will. Just have to figure out the correct overlay but that's no big deal. Will report here right away.
Comment 12 Maxim Britov 2011-04-17 12:22:20 UTC
Same here:
$ gimp
This is a development version of GIMP.  Debug messages may appear here.

(gimp:4854): Gimp-Core-WARNING **: Wrong translation for 'tags-locale:', fix the translation!
(gimp:4854): Gimp-Widgets-WARNING **: gimp_dialog_factory_add_foreign: dialog was created by a GimpDialogFactory
gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1

2.7.1 fine, 2.7.2 and git freez...
ps. git can't build with USE='python' on install stage.

GNU Image Manipulation Program version 2.7.3
git-describe: GIMP_2_7_2-14-g3d7e0f2

using GEGL version 0.1.6 (compiled against version 0.1.6)
using GLib version 2.28.6 (compiled against version 2.28.6)
using GdkPixbuf version 2.22.1 (compiled against version 2.22.1)
using GTK+ version 2.24.3 (compiled against version 2.24.3)
using Pango version 1.28.4 (compiled against version 1.28.4)
using Fontconfig version 2.8.0 (compiled against version 2.8.0)
using Cairo version 1.10.2 (compiled against version 1.10.2)

Enabled only "Core pointer".
Comment 13 hash 2011-04-18 16:17:46 UTC
That IS gonna be a funny one...

My friend who found this bug in first place and contacted Alexandre Prokoudine, have found the cause of it!

Before you read it, please take a seat as it most likely struck you down! :)

In any session you are in, except for KDE4, type following in console:
killall xscreensaver

Now start Gimp and test for bug's presence...
You'll see it'l be gone! :)
Comment 14 Maxim Britov 2011-04-18 18:30:14 UTC
(In reply to comment #13)

> killall xscreensaver

Yes, without xscreensaver process problem went out for me too.
Comment 15 Maxim Britov 2011-04-18 23:31:07 UTC
Yesterday (18/04/2011) released xscreensaver 5.13
I can't reproduce this issue on 5.13
Comment 16 Vince C. 2011-04-19 17:31:30 UTC
(In reply to comment #13)
> Before you read it, please take a seat as it most likely struck you down! :)

Sitting down, just in case...


> killall xscreensaver

Hmmmmm'okay...


> Now start Gimp and test for bug's presence...
> You'll see it'l be gone! :)

Runing Gimp. Dragging...

*BLAM*

(Ouch)

...

Holy M***F****K****! You could have warned that I'd *really* tumble down!

Curses, you were right!

Now a beer for you and your friend, honest. First thing that comes to my mind that would make sense is D-Bus. Am I warming up?

Someone has some cream for bruises now?
Comment 17 Vince C. 2011-04-19 18:32:26 UTC
My previous post was of course a joke in most of its content :D . No insult was meant.  I just confirm killing xscreensaver cures the problem I described in the bug report.

Thank you very much for finding the source. FYI I have xscreensaver-5.12 . Will try to upgrade to version 5.13 as soon as it hits Gentoo portage and report here.
Comment 18 Oleg Ivanenko 2011-07-03 17:51:56 UTC
(In reply to comment #13)
> That IS gonna be a funny one...
> 
> My friend who found this bug in first place and contacted Alexandre Prokoudine,
> have found the cause of it!
> 
> Before you read it, please take a seat as it most likely struck you down! :)
> 
> In any session you are in, except for KDE4, type following in console:
> killall xscreensaver
> 
> Now start Gimp and test for bug's presence...
> You'll see it'l be gone! :)

I have this bug with Gimp 2.6.11 on Xubuntu 11.04 and killing xscreensaver cures keyboard freezing but... I can't remove dragged in guides now instead. When I try to drag out guide active layer moves instead :)

Gimp 2.6.11 on Xubuntu 10.04 works fine.
Comment 19 Jamie Zawinski 2011-08-23 18:27:40 UTC
For the record, I have no idea how xscreensaver could be causing this. It does not hold grabs unless the screen saver is *active*, which obviously it can't be if you're in the middle of clicking.

xscreensaver *does* select events on random windows in order to detect idleness, so  perhaps the fact that some other app has selected events on one of its windows is confusing Gimp -- but that seems unlikely.

The idleness-detection code in xscreensaver hasn't changed in about a decade, so this isn't some new behavior.
Comment 20 Michael Natterer 2011-08-24 10:56:57 UTC
Thanks Jamie for the comment. I wonder if you could do us a favor, since
you clearly know best what's going on in xscreensaver. When you try
GIMP 2.7.3, and do whatever tool interaction on an image (like painting),
does *anything* happen in xscreensaver?

I'd really like to get to the bottom of this, and leave going back
to simply ignoring grab failures as last resort.

Thanks!
Comment 21 Ralf Oltmanns 2011-09-24 20:01:10 UTC
ralf@hunkpapa:~$ gimp -v
GNU Image Manipulation Program version 2.6.11

using GEGL version 0.0.22 (compiled against version 0.0.22)
using GLib version 2.28.6 (compiled against version 2.28.6)
using GTK+ version 2.24.4 (compiled against version 2.24.4)
using Pango version 1.28.4 (compiled against version 1.28.4)
using Fontconfig version 2.8.0 (compiled against version 2.8.0)

So, what do I do? There's no xscreenserver running on my Ubuntu 11.04 x64 and trying to drag guides from the rulers locks my gimp totally.

Any suggestions would be appreciated.
Comment 22 Vince C. 2011-09-24 21:42:13 UTC
I have have another issue that is now systematic. I don't know if this relates to this problem but I've been having it with Gimp 2.6 and I'm now having it with the current development version, gimp-9999 under Gentoo.

The issue is as follows: using menus with the mouse completely "disables" mouse buttons and wheel in dialog boxes, i.e. clicks are ineffective and the wheel doesn't change list items, increment areas, scrollers... Closing the dialog box with the ESC key makes the mouse usable again. But I must use only the keyboard with menus to be able to use the mouse in dialog boxes.

This issue occurs only with Gimp under several Xorg versions, current one is xorg-x11-7.4-r1, xorg-server-1.10.2. Using evdev as an input device for keyboard and mouse: xf86-input-evdev-2.6.0.

Should I file a new bug?
Comment 23 Michael Natterer 2011-10-26 13:29:33 UTC
Vince, if that bug is only in 2.6, there is no much use in filing it,
because 2.6 will be obsolete soon.
Comment 24 Michael Natterer 2011-10-26 13:30:49 UTC
*** Bug 656436 has been marked as a duplicate of this bug. ***
Comment 25 Michael Natterer 2011-10-26 13:32:48 UTC
Jamie, another question: we just realized that this does not happen
under gnome-screensaver.

None of us has a clue about the Xscreensaver or the gnome-screensaver
code, but AFAIK the gnome one was once a fork of Xscreensaver,
are you perhaps aware of any difference in the event handling
code?
Comment 26 Olivier Lecarme 2011-10-27 08:05:29 UTC
Two new informations about this problem:

- I cannot guarantee that the problem does not occur with a working gnome-screensaver, since currently my gnome-screensaver does not save at all. I tried uninstalling and installing it again, changing from Metacity to Compiz, considering the different solutions to that problem, which seems to be an old one in Ubuntu, but with to no avail.

- I had recently compiled GIMP from git, with several new libraries. I discovered that the Wacom tablet entries in the Input Devices dialog were grayed out, and people told me to compile gtk+ with the --with-xinput=yes option. I did that, compiled again GIMP against this new gtk+, and then the problem with Xscreensaver occurred.

- Just to be sure, i compiled again gtk+ with the --with-xinput=no option, and compiled GIMP once more. Then the problem with Xscreensaver does not occur any more.

Thus it seems that either I can use Xscreensaver and not my tablet, or the opposite. Maybe this evidence can help the developers?
Comment 27 Vince C. 2011-10-27 12:59:52 UTC
(In reply to comment #23)
> Vince, if that bug is only in 2.6, there is no much use in filing it,
> because 2.6 will be obsolete soon.

I'm also having this issue with the development version of Gimp, as I mentioned in comment #22. However... I have tried Gimp (still version 2.6, sorry) under Fedora 15 with a blank Gimp profile and I don't seem to have the issue.

Then I have copied back my old Gimp profile from Gentoo into Fedora's and the issue was back. I have no single idea what in the profile would cause that but fact is when I reuse my Gentoo profile for Gimp, I can't drag guides from any rulers. Maybe that devicerc, which doesn't exist in my blank Gimp profile?
Comment 28 Vince C. 2011-10-27 22:22:15 UTC
I confirm my previous comment #37 : if I start Gimp while there's no devicerc file under Gentoo, I can drag guides off the rulers. Whenever I touch the device configuration in Gimp and validate, a devicerc file is created and there come the troubles :( .

But the Evil thing is that under Gentoo Gimp by default doesn't handle pressure with my stylus (Wacom Bamboo Fun Pen & Touch)! So I need to change that somehow but as soon as I do, I can't drag guides off rulers anymore with the input device that has just been enabled! So if I enable my touchpad or change my mouse configuration, the same issue happens to them.

This is *very* annoying.

One thing I haven't understood is that under Fedora Gimp reacts to the pressure even though it has no devicerc file... Does that have anything to do with Xorg input configuration? Or anything else?

In short:

1. The device that is enabled (screen) [in Gimp input preferences] can no longer set new guides by dragging them *off* the rulers. However it can drag them once they're placed (using another tool, for instance)!

2. The device that has been enabled has issues with menus and dialog boxes in that once the tool is used to click menu items that prompt dialog boxes, pressing the dialog buttons or clicking anywhere no longer works. It happens *almost* systematically. Only rarely does it work normally.

3. Disabling the device gets rid of the issues.

And I repeat: this happens with 2.6 *and* the development version (from GIT) as well.
Comment 29 Vince C. 2011-10-27 22:23:32 UTC
Crap! comment #27 not 37! Sorry.
Comment 30 Michael Natterer 2011-12-09 19:38:14 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 31 Vince C. 2011-12-09 19:59:39 UTC
Excellent news! Thank you Michael! Is this fix applied to the 2.6 branch (and I presume to the upcoming 2.8) or only to the current development version of Gimp? Anyway I'm going to recompile Gimp from GIT on my Gentoo machine soon and check it.

Thanks again. Happy Gimping.
Comment 32 Michael Natterer 2011-12-10 10:35:53 UTC
Only to master, which will become 2.8.
Comment 33 Vince C. 2011-12-10 13:24:07 UTC
(In reply to comment #32)
> Only to master, which will become 2.8.

Can these fixes be backported to version 2.6?
Comment 34 Michael Natterer 2011-12-10 13:36:17 UTC
Nothing will be backported to 2.6 any more, sorry.
Comment 35 Vince C. 2011-12-11 17:17:01 UTC
(In reply to comment #34)
> Nothing will be backported to 2.6 any more, sorry.

Too bad for I seem to have issues getting and compiling missing dependencies as well as Gimp but I can wait until version 2.8 is available in portage. Will try anyway, won't give up right now.