aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Weninger2011-11-15 06:20:17 (EST)
committerUwe Stieber2011-11-15 06:20:17 (EST)
commit7339227458dc4cef2839172addce15c1ebcbd888 (patch)
tree84fa1aa8ff1930fa87e7923c1b779a134726890d
parent8fcf384ff08b81f05dcfb8b0909520ca8f7a1d25 (diff)
downloadorg.eclipse.tcf-7339227458dc4cef2839172addce15c1ebcbd888.zip
org.eclipse.tcf-7339227458dc4cef2839172addce15c1ebcbd888.tar.gz
org.eclipse.tcf-7339227458dc4cef2839172addce15c1ebcbd888.tar.bz2
Target Explorer: Fix calling ITerminals.setWinSize(...) to often
-rw-r--r--target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.ui/src/org/eclipse/tm/te/tcf/terminals/ui/connector/TerminalsConnector.java29
1 files changed, 19 insertions, 10 deletions
diff --git a/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.ui/src/org/eclipse/tm/te/tcf/terminals/ui/connector/TerminalsConnector.java b/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.ui/src/org/eclipse/tm/te/tcf/terminals/ui/connector/TerminalsConnector.java
index c2d5127..d8fd76c 100644
--- a/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.ui/src/org/eclipse/tm/te/tcf/terminals/ui/connector/TerminalsConnector.java
+++ b/target_explorer/plugins/org.eclipse.tm.te.tcf.terminals.ui/src/org/eclipse/tm/te/tcf/terminals/ui/connector/TerminalsConnector.java
@@ -28,6 +28,10 @@ public class TerminalsConnector extends AbstractStreamsConnector implements IDis
// Reference to the terminals settings
private final TerminalsSettings settings;
+ // Remember the last set window size
+ private int width = -1;
+ private int height = -1;
+
/**
* Constructor.
*/
@@ -99,16 +103,21 @@ public class TerminalsConnector extends AbstractStreamsConnector implements IDis
final ITerminals service = ((TerminalsLauncher)settings.getTerminalsLauncher()).getSvcTerminals();
final ITerminals.TerminalContext context = (ITerminals.TerminalContext)settings.getTerminalsLauncher().getAdapter(ITerminals.TerminalContext.class);
if (service != null && context != null) {
- Protocol.invokeLater(new Runnable() {
- @Override
- public void run() {
- service.setWinSize(context.getID(), newWidth, newHeight, new ITerminals.DoneCommand() {
- @Override
- public void doneCommand(IToken token, Exception error) {
- }
- });
- }
- });
+ if (width == -1 || height == -1 || newWidth != width || newHeight != height) {
+ width = newWidth;
+ height = newHeight;
+
+ Protocol.invokeLater(new Runnable() {
+ @Override
+ public void run() {
+ service.setWinSize(context.getID(), newWidth, newHeight, new ITerminals.DoneCommand() {
+ @Override
+ public void doneCommand(IToken token, Exception error) {
+ }
+ });
+ }
+ });
+ }
}
}
}