1
0
mirror of https://github.com/chylex/IntelliJ-Pin-Undocked-Tool-Windows.git synced 2024-11-25 04:42:46 +01:00

Compare commits

..

No commits in common. "8805ad545d1f77ad53c73067efb0def4aa6d4495" and "8c4d47fab8654d528d48ba58f4e040ca1c6440bd" have entirely different histories.

3 changed files with 7 additions and 16 deletions

View File

@ -8,14 +8,14 @@ plugins {
} }
group = "com.chylex.intellij.pinundockedtoolwindows" group = "com.chylex.intellij.pinundockedtoolwindows"
version = "1.1.0" version = "1.0.0"
repositories { repositories {
mavenCentral() mavenCentral()
} }
intellij { intellij {
version.set("2024.2") version.set("2023.1")
updateSinceUntilBuild.set(false) updateSinceUntilBuild.set(false)
} }

View File

@ -1,20 +1,15 @@
package com.chylex.intellij.pinundockedtoolwindows.patch package com.chylex.intellij.pinundockedtoolwindows.patch
import com.intellij.openapi.actionSystem.AnActionHolder import com.intellij.openapi.actionSystem.AnActionHolder
import com.intellij.openapi.application.ApplicationManager
import java.awt.AWTEvent import java.awt.AWTEvent
import java.awt.event.AWTEventListener import java.awt.event.AWTEventListener
import java.awt.event.MouseEvent import java.awt.event.MouseEvent
import java.util.Timer
import java.util.concurrent.atomic.AtomicInteger
import javax.swing.AbstractButton import javax.swing.AbstractButton
import kotlin.concurrent.schedule
object AwtClickListener : AWTEventListener { object AwtClickListener : AWTEventListener {
private val timer = Timer("Pin Undocked Tool Windows Click Timer", true) var wasPressingButton = false
private val pressingButtonCounter = AtomicInteger(0) private set
val wasPressingButton
get() = pressingButtonCounter.get() > 0
override fun eventDispatched(event: AWTEvent?) { override fun eventDispatched(event: AWTEvent?) {
if (event !is MouseEvent || event.id != MouseEvent.MOUSE_RELEASED) { if (event !is MouseEvent || event.id != MouseEvent.MOUSE_RELEASED) {
@ -23,8 +18,8 @@ object AwtClickListener : AWTEventListener {
val source = event.source val source = event.source
if (source is AbstractButton || source is AnActionHolder) { if (source is AbstractButton || source is AnActionHolder) {
pressingButtonCounter.incrementAndGet() wasPressingButton = true
timer.schedule(200L) { pressingButtonCounter.decrementAndGet() } ApplicationManager.getApplication().invokeLater { wasPressingButton = false }
} }
} }
} }

View File

@ -8,10 +8,6 @@
]]></description> ]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
<b>Version 1.1.0</b>
<ul>
<li>Allow hiding "Undock" tool windows for longer time after clicking a button.</li>
</ul>
<b>Version 1.0.0</b> <b>Version 1.0.0</b>
<ul> <ul>
<li>Prevents "Undock" tool windows from hiding when focus changes.</li> <li>Prevents "Undock" tool windows from hiding when focus changes.</li>