Commit 845eb522 authored by Jehan's avatar Jehan
Browse files

Bug 793777 - CRITICALs on focus change in MWM with stylus.

Focus change events were expecting the current tool control to be
inactive, which was the case most of the time. Yet with stylus, the
canvas was sometimes receiving GDK_BUTTON_PRESS events before
GDK_FOCUS_CHANGE. In particular the canvas was receiving a button press
before the focus out, then button release and focus in. Therefore by the
time the focus out event happens, the tool control is active, which
broke a few calls.
Therefore I add a few checks and returns immediately when
gimp_tool_control_is_active() return TRUE, especially since we also run
gimp_display_shell_update_focus() calls after a button press anyway so
the state should already be consistent.
parent cada28e9
......@@ -390,7 +390,8 @@ tool_manager_focus_display_active (Gimp *gimp,
tool_manager = tool_manager_get (gimp);
if (tool_manager->active_tool)
if (tool_manager->active_tool &&
! gimp_tool_control_is_active (tool_manager->active_tool->control))
{
gimp_tool_set_focus_display (tool_manager->active_tool,
display);
......@@ -448,7 +449,8 @@ tool_manager_oper_update_active (Gimp *gimp,
tool_manager = tool_manager_get (gimp);
if (tool_manager->active_tool)
if (tool_manager->active_tool &&
! gimp_tool_control_is_active (tool_manager->active_tool->control))
{
gimp_tool_oper_update (tool_manager->active_tool,
coords, state, proximity,
......@@ -468,7 +470,8 @@ tool_manager_cursor_update_active (Gimp *gimp,
tool_manager = tool_manager_get (gimp);
if (tool_manager->active_tool)
if (tool_manager->active_tool &&
! gimp_tool_control_is_active (tool_manager->active_tool->control))
{
gimp_tool_cursor_update (tool_manager->active_tool,
coords, state,
......
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