mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[UI, Wayland] IJPL-222880 Clean up ActionMenu UsabilityHelper
GitOrigin-RevId: 20deef38812595711e9993cf0878db7714ff96ff
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dfce322572
commit
e5820febc7
@@ -454,16 +454,20 @@ private class UsabilityHelper(component: Component) : IdeEventQueue.NonLockedEve
|
||||
*/
|
||||
private var window: Component? = ComponentUtil.getWindow(component)
|
||||
private var component: Component? = component
|
||||
private var startMousePoint: Point? = null
|
||||
private var xClosestToTargetSoFar = 0
|
||||
private var closestHorizontalDistanceSoFar = 0
|
||||
private var targetBounds: Rectangle? = null
|
||||
private var upperTargetPoint: Point? = null
|
||||
private var lowerTargetPoint: Point? = null
|
||||
private var eventToRedispatch: MouseEvent? = null
|
||||
private val pendingDispatchFlow = MutableStateFlow(false)
|
||||
private var done = false
|
||||
|
||||
// The stuff above needs to be cleaned up on dispose to avoid leaks.
|
||||
// The stuff below only holds cached computations.
|
||||
|
||||
private var startMousePoint: Point? = null
|
||||
private var targetBounds: Rectangle? = null
|
||||
private var upperTargetPoint: Point? = null
|
||||
private var lowerTargetPoint: Point? = null
|
||||
private var xClosestToTargetSoFar = 0
|
||||
private var closestHorizontalDistanceSoFar = 0
|
||||
|
||||
init {
|
||||
component.launchOnShow("ActionMenu.UsabilityHelper") {
|
||||
pendingDispatchFlow.debounce(50.milliseconds).collect { dispatch ->
|
||||
@@ -567,9 +571,6 @@ private class UsabilityHelper(component: Component) : IdeEventQueue.NonLockedEve
|
||||
window = null
|
||||
component = null
|
||||
eventToRedispatch = null
|
||||
lowerTargetPoint = null
|
||||
upperTargetPoint = null
|
||||
startMousePoint = null
|
||||
Toolkit.getDefaultToolkit().removeAWTEventListener(this)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user