# HG changeset patch
# User Jan Vrany <jan.vrany@fit.cvut.cz>
# Date 1513327751 0
# Fri Dec 15 08:49:11 2017 +0000
# Branch jv
# Node ID 52dc9c4dc4827811a12d0be632d36b047d384492
# Parent c6976b98f3c370b4f06146d5398371767462d814
Issue #176: do not close completion view on editor focus lost event
...if the currently focused view is the completion view. See
the comment in #editViewLostFocus for rationale.
See https://swing.fit.cvut.cz/projects/stx-jv/ticket/176
diff -r c6976b98f3c3 -r 52dc9c4dc482 EditTextView.st
a
|
b
|
|
6281 | 6281 | "/ completer. Otherwise, completion does not work when clocking into the list. |
6282 | 6282 | explicit ifTrue:[ |
6283 | 6283 | completionSupport notNil ifTrue:[ |
6284 | | completionSupport release. |
6285 | | ]. |
6286 | | ]. |
| 6284 | completionSupport editViewLostFocus. |
| 6285 | ]. |
| 6286 | ]. |
| 6287 | |
| 6288 | "Modified: / 15-12-2017 / 00:30:27 / jv" |
6287 | 6289 | ! |
6288 | 6290 | |
6289 | 6291 | wantsFocusWithPointerEnter |
diff -r c6976b98f3c3 -r 52dc9c4dc482 EditTextViewCompletionSupport.st
a
|
b
|
|
66 | 66 | therefore, allow for the activate of the completionMenu and its button event to be processed. |
67 | 67 | before forcing it to be closed..." |
68 | 68 | |
| 69 | "/ JV@2017-12-15: I don't really understand the problem and the solution. |
| 70 | "/ However, closing forcibly the completion view turned out to be a problem |
| 71 | "/ on Windows IF focus-follow-mouse is enabled: |
| 72 | "/ |
| 73 | "/ When a completion view is opened, it may be opened just "below" the mouse |
| 74 | "/ so the completion view gets the focus and edit view looses it. Since |
| 75 | "/ edit view lost focus, this method is called and completion view is closed. |
| 76 | "/ |
| 77 | "/ To handle this case, we do nothing IF completion view has the focus. |
| 78 | "/ |
| 79 | "/ See issue https://swing.fit.cvut.cz/projects/stx-jv/ticket/176 |
| 80 | "/ |
| 81 | editView device focusView == editView ifTrue:[ ^ self ]. |
| 82 | |
69 | 83 | completionView notNil ifTrue:[ |
70 | 84 | editView graphicsDevice anyButtonPressed ifTrue:[ |
71 | 85 | editView sensor pushUserEvent:#editViewLostFocus for:self. |
… |
… |
|
73 | 87 | self closeCompletionView |
74 | 88 | ] |
75 | 89 | ]. |
| 90 | |
| 91 | "Modified: / 15-12-2017 / 00:26:50 / jv" |
| 92 | "Modified (comment): / 15-12-2017 / 08:43:37 / jv" |
76 | 93 | ! |
77 | 94 | |
78 | 95 | handleKeyPress:key x:x y:y |
… |
… |
|
372 | 389 | |
373 | 390 | version_CVS |
374 | 391 | ^ '$Header$' |
| 392 | ! |
| 393 | |
| 394 | version_HG |
| 395 | |
| 396 | ^ '$Changeset: <not expanded> $' |
375 | 397 | ! ! |
376 | 398 | |