Cleaned up GTKEventDispatch
This commit is contained in:
parent
48511eebb3
commit
af24d1cfec
@ -17,7 +17,6 @@ package dorkbox.util.jna.linux;
|
|||||||
|
|
||||||
import static dorkbox.util.jna.linux.Gtk.Gtk2;
|
import static dorkbox.util.jna.linux.Gtk.Gtk2;
|
||||||
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
@ -390,18 +389,11 @@ class GtkEventDispatch {
|
|||||||
* @param callback will never be null.
|
* @param callback will never be null.
|
||||||
*/
|
*/
|
||||||
public static
|
public static
|
||||||
void proxyClick(final Object source, final ActionListener callback) {
|
void proxyClick(final ActionListener callback) {
|
||||||
isDispatch.set(true);
|
isDispatch.set(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (source != null) {
|
callback.actionPerformed(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);
|
|
||||||
}
|
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
LoggerFactory.getLogger(GtkEventDispatch.class)
|
LoggerFactory.getLogger(GtkEventDispatch.class)
|
||||||
.error("Error during GTK click callback: ", t);
|
.error("Error during GTK click callback: ", t);
|
||||||
|
Loading…
Reference in New Issue
Block a user