GNOME Bugzilla – Bug 645747
Gimp is now unusable on xfce4
Last modified: 2011-12-09 19:37:22 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
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.
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).
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)
Did you build from AUR or by hand?
I built by hand.
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?
This is how it builds gimp: https://aur.archlinux.org/packages/gimp-git/PKGBUILD Will try in the evening.
I see, and how do you start GIMP?
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).
+ Trace 226486
(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 }
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
I did the same on IceWM, and keyboard was grabbed (so I needed to run gdb from text console). And here is the callstack:
+ Trace 226487
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
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)
...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",
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
could possibly be related to #645315 try to see if killing xscreensaver "solves" the problem
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(-)