Cleaned up GTKEventDispatch

This commit is contained in:
nathan 2017-09-29 12:19:10 +02:00
parent 48511eebb3
commit af24d1cfec
1 changed files with 2 additions and 10 deletions

View File

@ -17,7 +17,6 @@ package dorkbox.util.jna.linux;
import static dorkbox.util.jna.linux.Gtk.Gtk2;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.LinkedList;
import java.util.concurrent.CountDownLatch;
@ -390,18 +389,11 @@ class GtkEventDispatch {
* @param callback will never be null.
*/
public static
void proxyClick(final Object source, final ActionListener callback) {
void proxyClick(final ActionListener callback) {
isDispatch.set(true);
try {
if (source != null) {
callback.actionPerformed(new ActionEvent(source, ActionEvent.ACTION_PERFORMED, ""));
}
else {
// checkbox entries will not pass the menuEntry in, because they redispatch the click event so that the checkbox state is
// toggled
callback.actionPerformed(null);
}
callback.actionPerformed(null);
} catch (Throwable t) {
LoggerFactory.getLogger(GtkEventDispatch.class)
.error("Error during GTK click callback: ", t);