More proper mouse grab killing in killfocus
This commit is contained in:
parent
6ea1edd358
commit
74ade46807
@ -1118,15 +1118,25 @@ open class EditablePanel<out S : Screen> @JvmOverloads constructor(
|
|||||||
if (isFocused) {
|
if (isFocused) {
|
||||||
isFocused = false
|
isFocused = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grabMouseInput = false
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun killGrabMouseInput() {
|
||||||
|
for (child in childrenInternal) {
|
||||||
|
child.killGrabMouseInput()
|
||||||
|
}
|
||||||
|
|
||||||
|
grabMouseInput = false
|
||||||
}
|
}
|
||||||
|
|
||||||
fun killFocus() {
|
fun killFocus() {
|
||||||
if (isEverFocused()) {
|
if (isEverFocused()) {
|
||||||
killFocusInternal()
|
killFocusInternal()
|
||||||
findAbsoluteRoot().updateFocus()
|
findAbsoluteRoot().updateFocus()
|
||||||
|
} else if (isGrabbingMouseInput()) {
|
||||||
|
killGrabMouseInput()
|
||||||
}
|
}
|
||||||
|
|
||||||
grabMouseInput = false
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun findHierarchicalFocus(): EditablePanel<*>? {
|
fun findHierarchicalFocus(): EditablePanel<*>? {
|
||||||
|
@ -1156,7 +1156,7 @@ open class TextInputPanel<out S : Screen>(
|
|||||||
cursorCharacter = pos.x
|
cursorCharacter = pos.x
|
||||||
|
|
||||||
isSelecting = true
|
isSelecting = true
|
||||||
grabMouseInput = true
|
tryToGrabMouseInput()
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user