[threading] IJPL-177735: Remove write-intent lock in more event dispatchers

GitOrigin-RevId: bdd2c067cfb2e0f78b3bff84f5484f197ee472c0
This commit is contained in:
Konstantin Nisht
2025-11-19 20:20:06 +00:00
committed by intellij-monorepo-bot
parent b3cdfb87b0
commit 4f4a05514e
2 changed files with 14 additions and 11 deletions
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.openapi.keymap.impl;
import com.intellij.codeWithMe.ClientId;
@@ -103,15 +103,14 @@ public final class ModifierKeyDoubleClickHandler {
if (dispatchers.isEmpty()) {
return false;
}
return WriteIntentReadAction.<Boolean, RuntimeException>compute(() -> {
boolean innerResult = false;
for (MyDispatcher dispatcher : doubleClickHandler.myDispatchers.values()) {
if (dispatcher.dispatch(keyEvent)) {
innerResult = true;
}
boolean innerResult = false;
for (MyDispatcher dispatcher : doubleClickHandler.myDispatchers.values()) {
if (dispatcher.dispatch(keyEvent)) {
innerResult = true;
}
return innerResult;
});
}
return innerResult;
}
}
@@ -1,4 +1,4 @@
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.internal.inspector
import com.intellij.ide.IdeEventQueue
@@ -41,7 +41,11 @@ abstract class UiMouseAction(val uiActionId: String) : DumbAwareAction() {
}
})
IdeEventQueue.getInstance().addDispatcher(::handleEvent, ApplicationManager.getApplication())
IdeEventQueue.getInstance().addDispatcher(object : IdeEventQueue.NonLockedEventDispatcher {
override fun dispatch(e: AWTEvent): Boolean {
return handleEvent(e)
}
}, ApplicationManager.getApplication())
}
private fun handleEvent(event: AWTEvent): Boolean {