Faculty of Information Technology
Software Engineering Group

Ticket #176: libwidg_fix_1_of_1_rev_52dc9c4dc482_Issue__176__do_not_close_completion_view_on_editor_focus_lost_event.patch

File libwidg_fix_1_of_1_rev_52dc9c4dc482_Issue__176__do_not_close_completion_view_on_editor_focus_lost_event.patch, 2.5 KB (added by Jan Vrany, 2 years ago)
  • EditTextView.st

    # 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  
    62816281    "/ completer. Otherwise, completion does not work when clocking into the list.
    62826282    explicit ifTrue:[
    62836283        completionSupport notNil ifTrue:[
    6284             completionSupport release.
    6285         ].
    6286     ].
     6284            completionSupport editViewLostFocus.
     6285        ].
     6286    ].
     6287
     6288    "Modified: / 15-12-2017 / 00:30:27 / jv"
    62876289!
    62886290
    62896291wantsFocusWithPointerEnter
  • EditTextViewCompletionSupport.st

    diff -r c6976b98f3c3 -r 52dc9c4dc482 EditTextViewCompletionSupport.st
    a b  
    6666     therefore, allow for the activate of the completionMenu and its button event to be processed.
    6767     before forcing it to be closed..."
    6868
     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
    6983    completionView notNil ifTrue:[
    7084        editView graphicsDevice anyButtonPressed ifTrue:[
    7185            editView sensor pushUserEvent:#editViewLostFocus for:self.
     
    7387            self closeCompletionView
    7488        ]
    7589    ].
     90
     91    "Modified: / 15-12-2017 / 00:26:50 / jv"
     92    "Modified (comment): / 15-12-2017 / 08:43:37 / jv"
    7693!
    7794
    7895handleKeyPress:key x:x y:y
     
    372389
    373390version_CVS
    374391    ^ '$Header$'
     392!
     393
     394version_HG
     395
     396    ^ '$Changeset: <not expanded> $'
    375397! !
    376398