summaryrefslogtreecommitdiff
path: root/libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java')
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java85
1 files changed, 42 insertions, 43 deletions
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java b/libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java
index 61df796dc00..8e593455774 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GtkClipboardNotifier.java
@@ -74,11 +74,11 @@ class GtkClipboardNotifier extends Thread
{
synchronized (notifier)
{
- if (clipboard == GtkClipboard.clipboard)
- announceClipboardChange = true;
- else
- announcePrimaryChange = true;
- notifier.notifyAll();
+ if (clipboard == GtkClipboard.clipboard)
+ announceClipboardChange = true;
+ else
+ announcePrimaryChange = true;
+ notifier.notifyAll();
}
}
@@ -87,44 +87,43 @@ class GtkClipboardNotifier extends Thread
GtkClipboard clipboard;
while (true)
{
- synchronized (this)
- {
- while (! announceClipboardChange && ! announcePrimaryChange)
- {
- try
- {
- this.wait();
- }
- catch (InterruptedException ie)
- {
- // ignore
- }
- }
-
- if (announceClipboardChange)
- {
- clipboard = GtkClipboard.clipboard;
- announceClipboardChange = false;
- }
- else
- {
- clipboard = GtkClipboard.selection;
- announcePrimaryChange = false;
- }
- }
-
- // Do the actual announcement without the lock held. We will
- // notice a new change after this notification has finished.
- try
- {
- clipboard.setContents(new GtkSelection(clipboard), null);
- }
- catch (Throwable t)
- {
- // should never happen, but might if we have some faulty
- // listener.
- t.printStackTrace();
- }
+ synchronized (this)
+ {
+ while (! announceClipboardChange && ! announcePrimaryChange)
+ {
+ try
+ {
+ this.wait();
+ }
+ catch (InterruptedException ie)
+ {
+ // ignore
+ }
+ }
+
+ if (announceClipboardChange)
+ {
+ clipboard = GtkClipboard.clipboard;
+ announceClipboardChange = false;
+ }
+ else
+ {
+ clipboard = GtkClipboard.selection;
+ announcePrimaryChange = false;
+ }
+ }
+
+ // Do the actual announcement without the lock held. We will
+ // notice a new change after this notification has finished.
+ try
+ {
+ clipboard.setContents(new GtkSelection(clipboard), null);
+ }
+ catch (Throwable t)
+ {
+ // should never happen, but might if we have some faulty listener.
+ t.printStackTrace();
+ }
}
}
}