Page MenuHome

Fix T72089: Image Editor - Paint mode, Clone Tool - disfunctional clear button in the Image slot in the Brush panel
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 5 2019, 1:36 AM.

Details

Summary

Caused/exposed by rBaf9ca138ba7b
Also relevant was rB828905190e12

Above commits moved the WM_UI_HANDLER_BREAK around so it would not be
returned anymore.
Still reading my way though UI handlers, but it seems (at least for the
Image Editor?) that we need this, otherwise we wont get through to to
KM_RELEASE. There are two places that explicitly check for KM_RELEASE
(call to ui_do_but_extra_operator_icon in both
ui_do_but_SEARCH_UNLINK / ui_do_button), and without the above we
only ever get here with KM_PRESS.

Possibly this has even other (deeper) causes, but this patch restores
the behavior regarding WM_UI_HANDLER_BREAK to what is was before the two
culprit commits.

Checked that both this report (T72089) and T69755 are working.

Diff Detail

Repository
rB Blender
Branch
T72089 (branched from master)
Build Status
Buildable 5908
Build 5908: arc lint + arc unit

Event Timeline

Sybren A. Stüvel (sybren) added inline comments.
source/blender/editors/interface/interface_handlers.c
4355–4370

Personally I would clarify this code by un-nesting some of the if-statements and just doing return WM_UI_HANDLER_CONTINUE; instead of /* pass */.

Julian Eisel (Severin) added inline comments.
source/blender/editors/interface/interface_handlers.c
4355–4370

Most other handlers here only filter out the cases when we want to break, and otherwise let execution go on to the single return WM_UI_HANDLER_CONTINUE at the end of the function. So there is a consistency argument here.

This code is a mess either way. There's not much we can do to change that at this granular level I'm afraid. In the end it doesn't really matter how we do this exactly.

This revision is now accepted and ready to land.Jan 28 2020, 11:27 AM