Skip to content

Commit

Permalink
Incorrect resize when in SplitView mode
Browse files Browse the repository at this point in the history
Fixes #121753357

When in SplitView mode, if you tried to make a window smaller but
cancelled the gesture, sometimes the resize finishes. The terminal size
was still good, but the internal number of columns was unchanged. It
looks like the events might be competing themselves, so by using the
function resizeTo nstead of doing it manually, we get it to work.
  • Loading branch information
Carlos Cabanero committed Aug 11, 2016
1 parent 44ac94f commit 77b229e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Resources/termcontrol.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@ var write_to_term = function(data) {
t.io.print(data);
}
var sigwinch = function() {
var screen = document.getElementsByTagName("iframe")[0].contentWindow.document.getElementsByTagName("x-screen")[0];
var view_w = window.innerWidth;
var view_h = window.innerHeight;
screen.style.width = view_w;
screen.style.height = view_h;

var termWindow = document.getElementsByTagName("iframe")[0].contentWindow;
termwindow.resizeTo(window.innerWidth, window.innerHeight);
}
window.addEventListener('resize', sigwinch);
var increaseTermFontSize = function() {
Expand Down

0 comments on commit 77b229e

Please sign in to comment.