git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
#38 fix Swing deadlock
[nikiroo-utils.git]
/
src
/
jexer
/
backend
/
TWindowBackend.java
diff --git
a/src/jexer/backend/TWindowBackend.java
b/src/jexer/backend/TWindowBackend.java
index a34ba78bc23f173b1d43b4066539b74825955fc3..3c1f832cfefdb8ba6cc2a0c10204abc2fec92306 100644
(file)
--- a/
src/jexer/backend/TWindowBackend.java
+++ b/
src/jexer/backend/TWindowBackend.java
@@
-28,16
+28,17
@@
*/
package jexer.backend;
*/
package jexer.backend;
-import java.util.
Linked
List;
+import java.util.
Array
List;
import java.util.List;
import java.util.List;
-import jexer.bits.CellAttributes;
+import jexer.TApplication;
+import jexer.TWindow;
+import jexer.event.TCommandEvent;
import jexer.event.TInputEvent;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
import jexer.event.TResizeEvent;
import jexer.event.TInputEvent;
import jexer.event.TKeypressEvent;
import jexer.event.TMouseEvent;
import jexer.event.TResizeEvent;
-import jexer.TApplication;
-import jexer.TWindow;
+import static jexer.TCommand.*;
/**
* TWindowBackend uses a window in one TApplication to provide a backend for
/**
* TWindowBackend uses a window in one TApplication to provide a backend for
@@
-135,7
+136,7
@@
public class TWindowBackend extends TWindow implements Backend {
super(application, title, width, height);
this.listener = listener;
super(application, title, width, height);
this.listener = listener;
- eventQueue = new
Linked
List<TInputEvent>();
+ eventQueue = new
Array
List<TInputEvent>();
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
@@
-161,7
+162,7
@@
public class TWindowBackend extends TWindow implements Backend {
super(application, title, width, height, flags);
this.listener = listener;
super(application, title, width, height, flags);
this.listener = listener;
- eventQueue = new
Linked
List<TInputEvent>();
+ eventQueue = new
Array
List<TInputEvent>();
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
@@
-188,7
+189,7
@@
public class TWindowBackend extends TWindow implements Backend {
super(application, title, x, y, width, height);
this.listener = listener;
super(application, title, x, y, width, height);
this.listener = listener;
- eventQueue = new
Linked
List<TInputEvent>();
+ eventQueue = new
Array
List<TInputEvent>();
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
@@
-217,7
+218,7
@@
public class TWindowBackend extends TWindow implements Backend {
super(application, title, x, y, width, height, flags);
this.listener = listener;
super(application, title, x, y, width, height, flags);
this.listener = listener;
- eventQueue = new
Linked
List<TInputEvent>();
+ eventQueue = new
Array
List<TInputEvent>();
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
sessionInfo = new TSessionInfo(width, height);
otherScreen = new OtherScreen(this);
otherScreen.setDimensions(width - 2, height - 2);
@@
-409,7
+410,9
@@
public class TWindowBackend extends TWindow implements Backend {
*/
@Override
public void onClose() {
*/
@Override
public void onClose() {
- // TODO: send a screen disconnect
+ synchronized (eventQueue) {
+ eventQueue.add(new TCommandEvent(cmBackendDisconnect));
+ }
}
// ------------------------------------------------------------------------
}
// ------------------------------------------------------------------------