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.
Showing with 6 additions and 3 deletions