changeset 67:d35b8478e089 default tip

Remove redundant event dispatch thread task submissions.
author David Barts <n5jrn@me.com>
date Sun, 12 Jan 2025 16:26:11 -0800
parents a8b04aa874e3
children
files src/name/blackcap/clipman/PasteboardQueue.kt
diffstat 1 files changed, 7 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/name/blackcap/clipman/PasteboardQueue.kt	Sun Jan 12 12:13:20 2025 -0800
+++ b/src/name/blackcap/clipman/PasteboardQueue.kt	Sun Jan 12 16:26:11 2025 -0800
@@ -55,10 +55,8 @@
      * @param item QueueItem to add
      */
     @Synchronized fun add(item: QueueItem) {
-        inSwingThread {
-            parent.add(item.view.contents)
-            validate()
-        }
+        parent.add(item.view.contents)
+        validate()
         queue.addLast(item)
         truncate()
     }
@@ -149,18 +147,16 @@
             var dirty = false
             while (size > _maxSize) {
                 var extra = queue.removeFirst().view
-                inSwingThread {
-                    if (extra.searchable.selected) {
-                        Application.anyRequired.disable()
-                        Application.styledRequired.disable()
-                    }
-                    parent.remove(extra.contents)
+                if (extra.searchable.selected) {
+                    Application.anyRequired.disable()
+                    Application.styledRequired.disable()
                 }
+                parent.remove(extra.contents)
                 dirty = true
                 size -= 1
             }
             if (dirty) {
-                inSwingThread { validate() }
+                validate()
             }
         }
     }