mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[platform] making shiny new IdeTooltipManager more crash-proof
(before the fix it produced ADEs on each mouse move over a startup error dialog) GitOrigin-RevId: 45a221b85d905ce958aceaa8ec119dfe5057bb99
This commit is contained in:
committed by
intellij-monorepo-bot
parent
713072b892
commit
9b18bd6ec4
@@ -12,6 +12,7 @@ import com.intellij.openapi.application.EDT
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.components.serviceAsync
|
||||
import com.intellij.openapi.components.serviceIfCreated
|
||||
import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.editor.colors.ColorKey
|
||||
import com.intellij.openapi.editor.colors.EditorColorsUtil
|
||||
@@ -65,13 +66,16 @@ private class SwingTooltipManagerCustomizer : ApplicationInitializedListener {
|
||||
asyncScope.launch {
|
||||
withContext(Dispatchers.EDT) {
|
||||
val ideTooltipManager by lazy {
|
||||
IdeTooltipManager.getInstance()
|
||||
serviceIfCreated<IdeTooltipManager>()
|
||||
}
|
||||
Toolkit.getDefaultToolkit().addAWTEventListener({
|
||||
if (isEnabled) {
|
||||
ideTooltipManager.eventDispatched(it as MouseEvent)
|
||||
}
|
||||
}, AWTEvent.MOUSE_EVENT_MASK or AWTEvent.MOUSE_MOTION_EVENT_MASK)
|
||||
Toolkit.getDefaultToolkit().addAWTEventListener(
|
||||
{
|
||||
if (isEnabled) {
|
||||
ideTooltipManager?.eventDispatched(it as MouseEvent)
|
||||
}
|
||||
},
|
||||
AWTEvent.MOUSE_EVENT_MASK or AWTEvent.MOUSE_MOTION_EVENT_MASK
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user