transfer focus before closing old component -- avoid intermediate focus switch to root component, which is actually visible e.g. on Windows;
authorwenzelm
Fri Nov 08 15:10:16 2013 +0100 (2013-11-08 ago)
changeset 543763eb84b6b0353
parent 54375 47a8513671b8
child 54377 750561986828
transfer focus before closing old component -- avoid intermediate focus switch to root component, which is actually visible e.g. on Windows;
src/Tools/jEdit/src/completion_popup.scala
src/Tools/jEdit/src/pretty_tooltip.scala
     1.1 --- a/src/Tools/jEdit/src/completion_popup.scala	Thu Nov 07 19:35:57 2013 +0100
     1.2 +++ b/src/Tools/jEdit/src/completion_popup.scala	Fri Nov 08 15:10:16 2013 +0100
     1.3 @@ -490,9 +490,8 @@
     1.4  
     1.5    private def hide_popup()
     1.6    {
     1.7 -    val had_focus = list_view.peer.isFocusOwner
     1.8 +    if (list_view.peer.isFocusOwner) refocus()
     1.9      popup.hide
    1.10 -    if (had_focus) refocus()
    1.11    }
    1.12  }
    1.13  
     2.1 --- a/src/Tools/jEdit/src/pretty_tooltip.scala	Thu Nov 07 19:35:57 2013 +0100
     2.2 +++ b/src/Tools/jEdit/src/pretty_tooltip.scala	Fri Nov 08 15:10:16 2013 +0100
     2.3 @@ -115,13 +115,13 @@
     2.4      deactivate()
     2.5      hierarchy(tip) match {
     2.6        case Some((old, _ :: rest)) =>
     2.7 -        old.foreach(_.hide_popup)
     2.8 -        tip.hide_popup
     2.9 -        stack = rest
    2.10          rest match {
    2.11            case top :: _ => top.request_focus
    2.12            case Nil => JEdit_Lib.request_focus_view
    2.13          }
    2.14 +        old.foreach(_.hide_popup)
    2.15 +        tip.hide_popup
    2.16 +        stack = rest
    2.17        case _ =>
    2.18      }
    2.19    }
    2.20 @@ -131,9 +131,9 @@
    2.21      deactivate()
    2.22      if (stack.isEmpty) false
    2.23      else {
    2.24 +      JEdit_Lib.request_focus_view
    2.25        stack.foreach(_.hide_popup)
    2.26        stack = Nil
    2.27 -      JEdit_Lib.request_focus_view
    2.28        true
    2.29      }
    2.30    }