diff options
author | Thomas Adam <thomas@xteddy.org> | 2012-11-27 22:24:00 +0000 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2012-11-27 22:24:00 +0000 |
commit | 739a76634c956016c44a89530d8ee9d20c4ed9f0 (patch) | |
tree | cda15fec72c5e350fa188359f6d8325a030d092a /window.c | |
parent | 39631edb98a542be53fce6f1eeef41880c9a76b4 (diff) | |
parent | 47c097cb51da9622180963af5391d142e7d4ade3 (diff) | |
download | rtmux-739a76634c956016c44a89530d8ee9d20c4ed9f0.tar.gz rtmux-739a76634c956016c44a89530d8ee9d20c4ed9f0.tar.bz2 rtmux-739a76634c956016c44a89530d8ee9d20c4ed9f0.zip |
Merge branch 'obsd-master'
Sync from OpenBSD.
Diffstat (limited to 'window.c')
-rw-r--r-- | window.c | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -877,7 +877,8 @@ window_pane_resize(struct window_pane *wp, u_int sx, u_int sy) * history is not updated */ void -window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc) +window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc, + int cursor) { struct screen *s = &wp->base; u_int sx, sy; @@ -891,8 +892,10 @@ window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc) wp->saved_grid = grid_create(sx, sy, 0); grid_duplicate_lines(wp->saved_grid, 0, s->grid, screen_hsize(s), sy); - wp->saved_cx = s->cx; - wp->saved_cy = s->cy; + if (cursor) { + wp->saved_cx = s->cx; + wp->saved_cy = s->cy; + } memcpy(&wp->saved_cell, gc, sizeof wp->saved_cell); grid_view_clear(s->grid, 0, 0, sx, sy); @@ -904,7 +907,8 @@ window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc) /* Exit alternate screen mode and restore the copied grid. */ void -window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc) +window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc, + int cursor) { struct screen *s = &wp->base; u_int sx, sy; @@ -925,10 +929,12 @@ window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc) /* Restore the grid, cursor position and cell. */ grid_duplicate_lines(s->grid, screen_hsize(s), wp->saved_grid, 0, sy); - s->cx = wp->saved_cx; + if (cursor) + s->cx = wp->saved_cx; if (s->cx > screen_size_x(s) - 1) s->cx = screen_size_x(s) - 1; - s->cy = wp->saved_cy; + if (cursor) + s->cy = wp->saved_cy; if (s->cy > screen_size_y(s) - 1) s->cy = screen_size_y(s) - 1; memcpy(gc, &wp->saved_cell, sizeof *gc); |