With https://developer.blender.org/D6098 I made some changes to hover behavior. One change was that it showed a hover highlight on items that are also selected. Although I prefer this look, this unfortunately can cause some flickering in some situations:
This because we quite often (necessarily) create, place, and draw buttons without respect to mouse position. So the initial state of buttons might be selected or not, but it is only later that we might determine that it is being hovered by the mouse. In between these times the button could be drawn and will therefore briefly flicker.
The following is an extreme example. While hovering over a selected item, a long press and drag will lose UI_ACTIVE state, without ever leaving the bounds of the control:
There just isn't a way to ensure that UI_ACTIVE and UI_SELECT are always in sync when they should be, throughout the lifetime of a button. This patch changes the behavior back to how it was before D6098 with hover highlight only shown if the button does not also have UI_SELECT.