mirror of https://github.com/GNOME/gimp.git
Bug 688715 - Unconfigured eraser should be set to eraser tool
I don't know what I tested before, but it didn't work. This patch does the magic in two places, one of which I missed.
This commit is contained in:
parent
512fbcbbb2
commit
4e340b613b
|
@ -37,6 +37,7 @@
|
|||
#include "core/gimpdatafactory.h"
|
||||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimpparamspecs.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "gimpdeviceinfo.h"
|
||||
|
||||
|
@ -634,6 +635,26 @@ gimp_device_info_set_device (GimpDeviceInfo *info,
|
|||
gimp_device_info_changed (info);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_device_info_set_default_tool (GimpDeviceInfo *info)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_DEVICE_INFO (info));
|
||||
|
||||
if (info->device &&
|
||||
gdk_device_get_source (info->device) == GDK_SOURCE_ERASER)
|
||||
{
|
||||
GimpContainer *tools = GIMP_CONTEXT (info)->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 (info), eraser);
|
||||
}
|
||||
}
|
||||
|
||||
GdkInputMode
|
||||
gimp_device_info_get_mode (GimpDeviceInfo *info)
|
||||
{
|
||||
|
|
|
@ -85,6 +85,8 @@ void gimp_device_info_set_device (GimpDeviceInfo *info,
|
|||
GdkDevice *device,
|
||||
GdkDisplay *display);
|
||||
|
||||
void gimp_device_info_set_default_tool (GimpDeviceInfo *info);
|
||||
|
||||
GdkInputMode gimp_device_info_get_mode (GimpDeviceInfo *info);
|
||||
void gimp_device_info_set_mode (GimpDeviceInfo *info,
|
||||
GdkInputMode mode);
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpmarshal.h"
|
||||
#include "core/gimptoolinfo.h"
|
||||
|
||||
#include "gimpdeviceinfo.h"
|
||||
#include "gimpdevicemanager.h"
|
||||
|
@ -330,18 +329,7 @@ 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_device_info_set_default_tool (device_info);
|
||||
|
||||
gimp_container_add (GIMP_CONTAINER (manager), GIMP_OBJECT (device_info));
|
||||
g_object_unref (device_info);
|
||||
|
|
|
@ -119,6 +119,8 @@ gimp_devices_restore (Gimp *gimp)
|
|||
|
||||
gimp_context_copy_properties (user_context, GIMP_CONTEXT (device_info),
|
||||
GIMP_DEVICE_INFO_CONTEXT_MASK);
|
||||
|
||||
gimp_device_info_set_default_tool (device_info);
|
||||
}
|
||||
|
||||
filename = gimp_personal_rc_file ("devicerc");
|
||||
|
|
Loading…
Reference in New Issue