Focus Issue with build 660

SyntaxEditor for WPF Forum

Posted 7 years ago by Shiouliang Quek
Version: 17.2.0661


Recently we upgraded the syntax editor to a newer version (build 660 and above), and we encounter some problem related to delimiter highlighting feature in our project.

We did some investigation and the issue seems to be related to DelimiterHighlightTagger::OnViewHasFocusChanged. In this handler, it should register the handler for DelimiterHighlightUpdate to the UniversalTimer when the view's HasFocusChanged event is trigger. But this is not happening, hence the delimiter highlighting is not working in our case.

We also observed that now the syntax editor can have the caret blinking even it does not have the keyboard focus. This is reproducible with the sample application. It is very confusing to user, especially if there are more than one syntax editor displaying on the same application.

it seems to be related to a change in CompatibilityHelper, where a new IsKeyboardFocusWithinView method is introduced.

Please advise if this is a problem in the new build, and if there is any workaround for now?


Comments (3)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA


Yes, the has-focus logic changed for the 2017.2 version since we had to better track whether focus was truly in the text area or was within an intra-line adornment.  We haven't seen the issue with the caret blinking when the control doesn't have focus though.  Can you tell us exactly how to reproduce this?

Also can you tell us how to easily reproduce the delimiter highlighting issue, or send us a new small sample project that shows it (and possibly the focus issue too) so we can debug with that and get you an updated build?  Please make sure the ZIP doesn't include any bin/obj folders, and rename the .zip file extension so it doesn't get spam blocked.


Actipro Software Support

Posted 7 years ago by Erwin Liong

Hi Actipro, 

Open notepad.

Open sample browser, place caret at syntax editor. Observe caret is blinking.

Switch over to notepad. 

Observe caret in notepad and syntax editor are both blinking. 


Observation on v2017.2 build 661

[Modified 7 years ago]

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA

Thanks, I believe we tracked down the problem.  In the updates for 2017.2 related to focus tracking for intra-line adornments, we had changed to only watching OnGotFocus/OnLostFocus instead of also OnIsFocusWithinChanged.  But the latter is needed when moving focus to other applications.  We've fixed this for the next build and also updated build 661 with a hotfix for this issue since we didn't want to have to wait to get it out until the next maintenance release.  If you redownload build 661, you should have the fix in there.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.