[gimp/gimp-2-8] Bug 688715 - Unconfigured eraser should be set to eraser tool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] Bug 688715 - Unconfigured eraser should be set to eraser tool
- Date: Thu, 22 Nov 2012 22:48:24 +0000 (UTC)
commit 54ae57f2900e41fb62b09bf7bfeb7214eb6b55f9
Author: Michael Natterer <mitch gimp org>
Date: Thu Nov 22 23:43:41 2012 +0100
Bug 688715 - Unconfigured eraser should be set to eraser tool
If a device has no saved settings, and it is a GDK_SOURCE_ERASER, set
it to the eraser tool.
(cherry picked from commit 512fbcbbb23c0c449184b90d942dc7241d96b1a8)
app/widgets/gimpdevicemanager.c | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpdevicemanager.c b/app/widgets/gimpdevicemanager.c
index a7d2c46..e2cf988 100644
--- a/app/widgets/gimpdevicemanager.c
+++ b/app/widgets/gimpdevicemanager.c
@@ -28,6 +28,7 @@
#include "core/gimp.h"
#include "core/gimpmarshal.h"
+#include "core/gimptoolinfo.h"
#include "gimpdeviceinfo.h"
#include "gimpdevicemanager.h"
@@ -329,6 +330,19 @@ gimp_device_manager_device_added (GdkDisplay *gdk_display,
{
device_info = gimp_device_info_new (private->gimp, device, gdk_display);
+ if (gdk_device_get_source (device) == GDK_SOURCE_ERASER)
+ {
+ GimpContainer *tools = private->gimp->tool_info_list;
+ GimpToolInfo *eraser;
+
+ eraser =
+ GIMP_TOOL_INFO (gimp_container_get_child_by_name (tools,
+ "gimp-eraser-tool"));
+
+ if (eraser)
+ gimp_context_set_tool (GIMP_CONTEXT (device_info), eraser);
+ }
+
gimp_container_add (GIMP_CONTAINER (manager), GIMP_OBJECT (device_info));
g_object_unref (device_info);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]