[gimp] app: fix "grabbing" of extended devices
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix "grabbing" of extended devices
- Date: Thu, 3 Mar 2011 21:40:47 +0000 (UTC)
commit 7a47e36c636f5db32a0b18571cc2408cf6415f8d
Author: Michael Natterer <mitch gimp org>
Date: Thu Mar 3 22:38:50 2011 +0100
app: fix "grabbing" of extended devices
If grabbing fails with GDK_GRAB_ALREADY_GRABBED (which it always
does), simply silently ignore that and assume the grab succeesed
anyway (puke).
app/display/gimpdisplayshell-grab.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-grab.c b/app/display/gimpdisplayshell-grab.c
index a9dc48f..1320a47 100644
--- a/app/display/gimpdisplayshell-grab.c
+++ b/app/display/gimpdisplayshell-grab.c
@@ -23,6 +23,11 @@
#include "display-types.h"
+#include "widgets/gimpdeviceinfo.h"
+#include "widgets/gimpdevices.h"
+#include "widgets/gimpdevicemanager.h"
+
+#include "gimpdisplay.h"
#include "gimpdisplayshell.h"
#include "gimpdisplayshell-grab.h"
@@ -48,6 +53,25 @@ gimp_display_shell_pointer_grab (GimpDisplayShell *shell,
return TRUE;
}
+ else if (status == GDK_GRAB_ALREADY_GRABBED)
+ {
+ GimpDeviceManager *manager;
+ GdkDisplay *gdk_display;
+
+ manager = gimp_devices_get_manager (shell->display->gimp);
+ gdk_display = gtk_widget_get_display (GTK_WIDGET (shell));
+
+ /* EEK: trying to grab an extended device always returns
+ * ALREADY_GRABBED, so simply assume the grab succeeded anyway
+ */
+ if (gimp_device_manager_get_current_device (manager)->device !=
+ gdk_display_get_core_pointer (gdk_display))
+ {
+ shell->pointer_grabbed = TRUE;
+
+ return TRUE;
+ }
+ }
g_printerr ("%s: gdk_pointer_grab failed with status %d\n",
G_STRFUNC, status);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]