GitLab repository storage has been migrated to hashed layout. Please contact Infrastructure team if you notice any issues with repositories or hooks.

Commit 7a47e36c authored by Michael Natterer's avatar Michael Natterer 😴

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).
parent e3c0a4e5
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment