Lines 87-93
Link Here
|
87 |
String tty = PtySupport.getTTY(process); |
87 |
String tty = PtySupport.getTTY(process); |
88 |
if (tty != null) { |
88 |
if (tty != null) { |
89 |
try { |
89 |
try { |
90 |
IONotifier.addPropertyChangeListener(io, new ResizeListener(process.getExecutionEnvironment(), tty)); |
90 |
ResizeListener resizeListener = new ResizeListener(io, process.getExecutionEnvironment(), tty); |
|
|
91 |
IONotifier.addPropertyChangeListener(io, resizeListener); |
91 |
} catch (CancellationException ex) { |
92 |
} catch (CancellationException ex) { |
92 |
// TODO:CancellationException error processing |
93 |
// TODO:CancellationException error processing |
93 |
} catch (IOException ex) { |
94 |
} catch (IOException ex) { |
Lines 118-124
Link Here
|
118 |
|
119 |
|
119 |
if (IOResizable.isSupported(io)) { |
120 |
if (IOResizable.isSupported(io)) { |
120 |
try { |
121 |
try { |
121 |
IONotifier.addPropertyChangeListener(io, new ResizeListener(pty.getEnv(), pty.getSlaveName())); |
122 |
ResizeListener resizeListener = new ResizeListener(io, pty.getEnv(), pty.getSlaveName()); |
|
|
123 |
IONotifier.addPropertyChangeListener(io, resizeListener); |
122 |
} catch (IOException ex) { |
124 |
} catch (IOException ex) { |
123 |
Exceptions.printStackTrace(ex); |
125 |
Exceptions.printStackTrace(ex); |
124 |
} catch (CancellationException ex) { |
126 |
} catch (CancellationException ex) { |
Lines 133-144
Link Here
|
133 |
|
135 |
|
134 |
private final Object lock = new Object(); |
136 |
private final Object lock = new Object(); |
135 |
|
137 |
|
|
|
138 |
private final InputOutput io; |
139 |
|
136 |
private Task task = null; |
140 |
private Task task = null; |
137 |
private Dimension cells; |
141 |
private Dimension cells; |
138 |
private Dimension pixels; |
142 |
private Dimension pixels; |
139 |
private final boolean pxlsAware; |
143 |
private final boolean pxlsAware; |
140 |
|
144 |
|
141 |
ResizeListener(final ExecutionEnvironment env, final String tty) throws IOException, CancellationException { |
145 |
ResizeListener(InputOutput io, final ExecutionEnvironment env, final String tty) throws IOException, CancellationException { |
|
|
146 |
this.io = io; |
147 |
|
142 |
final HostInfo hinfo = HostInfoUtils.getHostInfo(env); |
148 |
final HostInfo hinfo = HostInfoUtils.getHostInfo(env); |
143 |
|
149 |
|
144 |
if (OSFamily.SUNOS.equals(hinfo.getOSFamily())) { |
150 |
if (OSFamily.SUNOS.equals(hinfo.getOSFamily())) { |
Lines 180-185
Link Here
|
180 |
: String.format("cols %d rows %d", c.width, c.height); // NOI18N |
186 |
: String.format("cols %d rows %d", c.width, c.height); // NOI18N |
181 |
|
187 |
|
182 |
SttySupport.apply(env, tty, cmd); |
188 |
SttySupport.apply(env, tty, cmd); |
|
|
189 |
|
190 |
IOTerm.updateScreen(ResizeListener.this.io); |
183 |
} |
191 |
} |
184 |
}, true); |
192 |
}, true); |
185 |
} |
193 |
} |
Lines 204-210
Link Here
|
204 |
this.pixels = new Dimension(newPixels); |
212 |
this.pixels = new Dimension(newPixels); |
205 |
} |
213 |
} |
206 |
|
214 |
|
207 |
task.schedule(0); |
215 |
// 1s delay helps us to ignore tons of events when resizing (i.e. continiusly, using mouse).ы |
|
|
216 |
task.schedule(1000); |
208 |
} |
217 |
} |
209 |
} |
218 |
} |
210 |
} |
219 |
} |