From da51309673b2374981fc4e03f7da4bb3be2b2350 Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Fri, 7 Dec 2007 18:54:46 +0000 Subject: [PATCH] if a device change happens, make sure we update the new active tool's 2007-12-07 Michael Natterer * app/display/gimpdisplayshell-callbacks.c (gimp_display_shell_tool_events): if a device change happens, make sure we update the new active tool's focus display and modifier state. Fixes most of bug #493176. svn path=/trunk/; revision=24288 --- ChangeLog | 7 +++++++ app/display/gimpdisplayshell-callbacks.c | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6d1139d3a4..a202f5655d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-12-07 Michael Natterer + + * app/display/gimpdisplayshell-callbacks.c + (gimp_display_shell_tool_events): if a device change happens, make + sure we update the new active tool's focus display and modifier + state. Fixes most of bug #493176. + 2007-12-07 Michael Natterer * app/gimp-log.[ch]: renamed log domain TOOLS to TOOL_EVENTS and diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c index f0bf14906b..f2951489e1 100644 --- a/app/display/gimpdisplayshell-callbacks.c +++ b/app/display/gimpdisplayshell-callbacks.c @@ -606,6 +606,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, GimpCoords image_coords; GdkModifierType state; guint32 time; + gboolean device_changed = FALSE; gboolean return_val = FALSE; gboolean update_sw_cursor = FALSE; @@ -629,6 +630,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, if (! gimp->busy && gimp_devices_check_change (gimp, event)) { gimp_display_shell_check_device_cursor (shell); + device_changed = TRUE; } gimp_display_shell_get_event_coords (shell, event, @@ -662,6 +664,14 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, } } + /* If the device (and maybe the tool) has changed, update the new + * tool's state + */ + if (device_changed && GTK_WIDGET_HAS_FOCUS (canvas)) + { + gimp_display_shell_update_focus (shell, &image_coords, state); + } + switch (event->type) { case GDK_ENTER_NOTIFY: