Can't resize my windows after SIGWINCH #23

Closed
vslinko opened this Issue Nov 28, 2012 · 3 comments

Projects

None yet

4 participants

@vslinko

Thanks @mscdex for your bindings!

* Find out why after calling endwin and refresh, the LINES and COLS globals are
  not updated appropriately after SIGWINCH.
  Also, ncurses' SIGWINCH handler that is included by default during build time
  does not cause a keyboard event to fire when it inserts KEY_RESIZE into the
  keyboard buffer, it merely uses ungetch to push it onto the top of the buffer.

Do you have some information about this point from TODO?
I can't resize my windows:

var redrawNowPlayingWindow = function () {
    var lineNo = parseInt(nowPlayingWindow.height / 2 - 1);

    nowPlayingWindow.erase();
    nowPlayingWindow.centertext(lineNo, currentTrackMetadata.artist.join(', '));
    nowPlayingWindow.centertext(lineNo + 1, nc.lines.toString());
    nowPlayingWindow.refresh();
};

process.on('SIGWINCH', function () {
    nowPlayingWindow.resize(nc.lines, nc.cols);
    redrawNowPlayingWindow();
});
@bpytlik

Try doing a nc.cleanup before your call to resize. I don't know if it's the "right" thing to do, or if there's a better way to do it. But it works for me at least.

@damianb

This is a bit of a killer, would really like to see this one fixed because it means that we're stuck with window sizes on startup. :\

@James-Snow

I've just bumped up against this as well. Anyone have any insight into where the problem might lie? I think I've chased the nc.lines and nc.cols properties to here in binding.cc:

 static Handle<Value> LinesStateGetter (Local<String> property,
                                        const AccessorInfo& info) {
   assert(property == lines_state_symbol);

   HandleScope scope;

   return scope.Close(Integer::New(LINES));
 }

 static Handle<Value> ColsStateGetter (Local<String> property,
                                       const AccessorInfo& info) {
   assert(property == cols_state_symbol);

   HandleScope scope;

   return scope.Close(Integer::New(COLS));
 }

But I'm way beyond my C++ knowledge at this point.

@vslinko vslinko closed this May 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment