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 645747 - Gimp is now unusable on xfce4
Gimp is now unusable on xfce4
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: User Interface
git master
Other Linux
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2011-03-26 13:48 UTC by Jacek Poplawski
Modified: 2011-12-09 19:37 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Jacek Poplawski 2011-03-26 13:48:45 UTC
(this is from Bug 643155)

Looks like after recent changes Gimp is no longer usable on xfce4 desktop.

I removed all configuration files to make sure this is not something with my setup, I started Gimp on clear xfce4 installation and the problem is still there.

Steps to reproduction:
1) start xfce4
2) start Gimp
3) open any image (may be new empty one)
4) try to paint
result:

gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1

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

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

This happens only on xfce4, and I think it's not related to xfwm, because I tried to replace WM with "--replace" and problem was still visible.

I use Arch Linux, Gimp compiled from git, and xfce is:

gtk-xfce-engine 2.8.1-1
libxfce4menu 4.6.2-1
libxfce4ui 4.8.0-1
libxfce4util 4.8.1-1
libxfcegui4 4.8.1-1
xfce4-appfinder 4.8.0-1
xfce4-mixer 4.8.0-1
xfce4-panel 4.8.2-1
xfce4-session 4.8.1-1
xfce4-settings 4.8.1-2
xfce-utils 4.8.1-1
Comment 1 Michael Natterer 2011-03-26 14:04:32 UTC
This is so weird. Could actually be a GTK+ bug. In bug #643155 you 
say you use gtk+ 2.22. Could you try gtk+ 2.24? GIMP 2.8 will depend
on 2.24 anyway.
Comment 2 Jacek Poplawski 2011-03-26 14:21:45 UTC
Currently I can't. There are no updates of gtk2 in Arch Linux, and when I tried to manually build 2.24.3 there was an compilation error in place I don't understand (I use gcc 4.5.2 if that matters).
Comment 3 Christian Dywan 2011-03-28 10:24:43 UTC
I just built Gimp master, also Archlinux and Xfce 4.8.1. I don't have any problems painting, erasing or cutting from a quick test run. I also don't see any of the above warnings.

$ gimp-2.7 -v                                                                
GNU Image Manipulation Program version 2.7.2
git-describe: GIMP_2_7_1-1572-g1c0fe73

using GEGL version 0.1.6 (compiled against version 0.1.6)
using GLib version 2.29.2 (compiled against version 2.29.2)
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 4 Jacek Poplawski 2011-03-28 11:23:57 UTC
Did you build from AUR or by hand?
Comment 5 Christian Dywan 2011-03-28 12:41:32 UTC
I built by hand.
Comment 6 Michael Natterer 2011-03-28 13:18:51 UTC
This AUR, whatever it is, does it really build GIMP master, or does it
use some older git version? Can you try building GIMP by hand and
report back please?
Comment 7 Jacek Poplawski 2011-03-28 13:24:09 UTC
This is how it builds gimp:

https://aur.archlinux.org/packages/gimp-git/PKGBUILD

Will try in the evening.
Comment 8 Michael Natterer 2011-03-28 17:23:56 UTC
I see, and how do you start GIMP?
Comment 9 Jacek Poplawski 2011-03-28 18:09:43 UTC
1) I removed gimp-git package from system
2) I removed whole /usr/local to make sure that older libraries don't affect the test
3) I compiled by hand sources from git and "make install", so gimp is installed in /usr/local
4) I started gimp-2.7

still same result in xfce4

Will try to download source from git by hand (they were downloaded the way I showed in Comment 7), upgrade glib (in Comment 3 it was never than mine).

I use this video card:
01:00.0 VGA compatible controller: ATI Technologies Inc RV770 [Radeon HD 4850]
and Wacom Bamboo if that matters (but now I am just testing with mouse).
Comment 10 Jacek Poplawski 2011-03-28 20:30:15 UTC


  • #0 gimp_display_shell_keyboard_ungrab
    at gimpdisplayshell-grab.c line 126
  • #1 gimp_display_shell_canvas_tool_events
    at gimpdisplayshell-tool-events.c line 688
  • #2 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 ??
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #7 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #10 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #11 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #12 ??
    from /usr/lib/libglib-2.0.so.0
  • #13 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #14 app_run
    at app.c line 252
  • #15 main
    at main.c line 425

Comment 11 Jacek Poplawski 2011-03-28 20:31:16 UTC
(gdb) n
127	  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
(gdb) n
126	{
(gdb) n
127	  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
(gdb) n
128	  g_return_if_fail (event != NULL);
(gdb) n
129	  g_return_if_fail (shell->keyboard_grabbed == TRUE);
(gdb) n

(gimp-2.7:4015): Gimp-Display-CRITICAL **: gimp_display_shell_keyboard_ungrab: assertion `shell->keyboard_grabbed == TRUE' failed
135	}
Comment 12 Jacek Poplawski 2011-03-28 20:35:13 UTC
keyboard_grabbed is set to TRUE only in gimp_display_shell_keyboard_grab, I set breakpoint on gimp_display_shell_keyboard_grab and it was never called
Comment 13 Jacek Poplawski 2011-03-28 20:47:26 UTC
I did the same on IceWM, and keyboard was grabbed (so I needed to run gdb from text console). And here is the callstack:

  • #0 gimp_display_shell_keyboard_grab
    at gimpdisplayshell-grab.c line 99
  • #1 gimp_display_shell_canvas_tool_events
    at gimpdisplayshell-tool-events.c line 512
  • #2 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #3 g_closure_invoke
    from /usr/lib/libgobject-2.0.so.0
  • #4 ??
    from /usr/lib/libgobject-2.0.so.0
  • #5 g_signal_emit_valist
    from /usr/lib/libgobject-2.0.so.0
  • #6 g_signal_emit
    from /usr/lib/libgobject-2.0.so.0
  • #7 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #8 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #9 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #10 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #11 g_main_context_dispatch
    from /usr/lib/libglib-2.0.so.0
  • #12 ??
    from /usr/lib/libglib-2.0.so.0
  • #13 g_main_loop_run
    from /usr/lib/libglib-2.0.so.0
  • #14 app_run
    at app.c line 252
  • #15 main
    at main.c line 425
  • #1 gimp_display_shell_canvas_tool_events
    at gimpdisplayshell-tool-events.c line 512
507
508                 if (! gimp_display_shell_pointer_grab (shell, event, event_mask))
509                   return TRUE;
510
511                 if (! shell->space_pressed && ! shell->space_release_pending)
512                   if (! gimp_display_shell_keyboard_grab (shell, event))
513                     {
514                       gimp_display_shell_pointer_ungrab (shell, event);
515                       return TRUE;
516                     }
(gdb)

on xfce4 it never reach that line, it returned from this function earlier
Comment 14 Jacek Poplawski 2011-03-28 20:53:54 UTC
And this is how the same code works on xfce4:

(gdb) break gimpdisplayshell-tool-events.c:437
Breakpoint 1 at 0x818cff0: file gimpdisplayshell-tool-events.c, line 437.
(gdb) r
Starting program: /usr/local/bin/gimp-2.7 
[Thread debugging using libthread_db enabled]
This is a development version of GIMP.  Debug messages may appear here.

[New Thread 0xb6c41b70 (LWP 4631)]
[New Thread 0xb6440b70 (LWP 4632)]
[New Thread 0xb5c3fb70 (LWP 4633)]
[New Thread 0xb543eb70 (LWP 4634)]

Breakpoint 1, gimp_display_shell_canvas_tool_events (canvas=0x8ef8378, 
    event=0x95316e0, shell=0x94ea0a0) at gimpdisplayshell-tool-events.c:448
448	        if (! gtk_widget_has_focus (canvas))
(gdb) n
457	        if (! gtk_widget_has_focus (canvas))
(gdb) n
475	        if (gimp->busy || shell->scrolling)
(gdb) n
476	          return TRUE;

But I don't understand why the condition is true;

(gdb) print gimp->busy
$1 = 0
(gdb) print shell->scrolling
$2 = 0
(gdb)
Comment 15 Jacek Poplawski 2011-03-28 21:14:25 UTC
...so I commented out lines 475-476, recompiled gimp and now:

Breakpoint 1, gimp_display_shell_pointer_grab (shell=0x94ea0a0, event=0x9531908, event_mask=544)
    at gimpdisplayshell-grab.c:39
39	{
(gdb) n
42	  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
(gdb) n
39	{
(gdb) n
42	  g_return_val_if_fail (GIMP_IS_DISPLAY_SHELL (shell), FALSE);
(gdb) n
43	  g_return_val_if_fail (event != NULL, FALSE);
(gdb) n
44	  g_return_val_if_fail (shell->pointer_grabbed == FALSE, FALSE);
(gdb) n
46	  status = gdk_pointer_grab (gtk_widget_get_window (shell->canvas),
(gdb) n
50	  if (status == GDK_GRAB_SUCCESS)
(gdb) n
46	  status = gdk_pointer_grab (gtk_widget_get_window (shell->canvas),
(gdb) n
50	  if (status == GDK_GRAB_SUCCESS)
(gdb) n
56	  else if (status == GDK_GRAB_ALREADY_GRABBED)
(gdb) n
76	  g_printerr ("%s: gdk_pointer_grab failed with status %d\n",
Comment 16 Jacek Poplawski 2011-04-08 00:09:27 UTC
I was able to update libraries and compile current git:

GEGL używa wersji 0.1.7 (skompilowano wersję 0.1.7)
GLib używa wersji 2.28.5 (skompilowano wersję 2.28.5)
GTK+ używa wersji 2.24.4 (skompilowano wersję 2.24.4)
Pango używa wersji 1.28.4 (skompilowano wersję 1.28.4)
Fontconfig używa wersji 2.8.0 (skompilowano wersję 2.8.0)

problem is still there, but the message has been shortened to only:

gimp_display_shell_pointer_grab: gdk_pointer_grab failed with status 1
Comment 17 Matteo 'Peach' Pescarin 2011-08-23 14:13:41 UTC
could possibly be related to #645315

try to see if killing xscreensaver "solves" the problem
Comment 18 Michael Natterer 2011-12-09 19:37:22 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(-)