Because we defer actually resizing applications (calling TIOCSWINSZ)
until the end of the server loop, tmux may have gone through several
internal resizes in between. This can be a problem if the final size is
the same as the initial size (what the application things it currently
is), because the application may choose not to redraw, assuming the
screen state is unchanged, when in fact tmux has thrown away parts of
the screen, assuming the application will redraw them.

To avoid this, do an extra resize if the new size is the same size as
the initial size. This should force the application to redraw when tmux
needs it to, while retaining the benefits of deferring (so we now resize
at most two times instead of at most one - and only two very rarely).

Fixes a problem with break-pane and zoomed panes reported by Michal
Mazurek.
3 files changed
tree: 0565b5090e2fc22242975626ed4f50111a53b605
  1. Makefile
  2. alerts.c
  3. arguments.c
  4. attributes.c
  5. cfg.c
  6. client.c
  7. cmd-attach-session.c
  8. cmd-bind-key.c
  9. cmd-break-pane.c
  10. cmd-capture-pane.c
  11. cmd-choose-tree.c
  12. cmd-command-prompt.c
  13. cmd-confirm-before.c
  14. cmd-copy-mode.c
  15. cmd-detach-client.c
  16. cmd-display-message.c
  17. cmd-display-panes.c
  18. cmd-find-window.c
  19. cmd-find.c
  20. cmd-has-session.c
  21. cmd-if-shell.c
  22. cmd-join-pane.c
  23. cmd-kill-pane.c
  24. cmd-kill-server.c
  25. cmd-kill-session.c
  26. cmd-kill-window.c
  27. cmd-list-buffers.c
  28. cmd-list-clients.c
  29. cmd-list-keys.c
  30. cmd-list-panes.c
  31. cmd-list-sessions.c
  32. cmd-list-windows.c
  33. cmd-list.c
  34. cmd-load-buffer.c
  35. cmd-lock-server.c
  36. cmd-move-window.c
  37. cmd-new-session.c
  38. cmd-new-window.c
  39. cmd-paste-buffer.c
  40. cmd-pipe-pane.c
  41. cmd-queue.c
  42. cmd-refresh-client.c
  43. cmd-rename-session.c
  44. cmd-rename-window.c
  45. cmd-resize-pane.c
  46. cmd-respawn-pane.c
  47. cmd-respawn-window.c
  48. cmd-rotate-window.c
  49. cmd-run-shell.c
  50. cmd-save-buffer.c
  51. cmd-select-layout.c
  52. cmd-select-pane.c
  53. cmd-select-window.c
  54. cmd-send-keys.c
  55. cmd-send-prefix.c
  56. cmd-set-buffer.c
  57. cmd-set-environment.c
  58. cmd-set-hook.c
  59. cmd-set-option.c
  60. cmd-show-buffer.c
  61. cmd-show-environment.c
  62. cmd-show-messages.c
  63. cmd-show-options.c
  64. cmd-source-file.c
  65. cmd-split-window.c
  66. cmd-string.c
  67. cmd-swap-pane.c
  68. cmd-swap-window.c
  69. cmd-switch-client.c
  70. cmd-unbind-key.c
  71. cmd-wait-for.c
  72. cmd.c
  73. colour.c
  74. control-notify.c
  75. control.c
  76. environ.c
  77. format.c
  78. grid-view.c
  79. grid.c
  80. hooks.c
  81. input-keys.c
  82. input.c
  83. job.c
  84. key-bindings.c
  85. key-string.c
  86. layout-custom.c
  87. layout-set.c
  88. layout.c
  89. log.c
  90. mode-key.c
  91. mode-tree.c
  92. names.c
  93. notify.c
  94. options-table.c
  95. options.c
  96. paste.c
  97. proc.c
  98. procname.c
  99. resize.c
  100. screen-redraw.c
  101. screen-write.c
  102. screen.c
  103. server-client.c
  104. server-fn.c
  105. server.c
  106. session.c
  107. signal.c
  108. status.c
  109. style.c
  110. tmux.1
  111. tmux.c
  112. tmux.h
  113. tty-acs.c
  114. tty-keys.c
  115. tty-term.c
  116. tty.c
  117. utf8.c
  118. window-buffer.c
  119. window-client.c
  120. window-clock.c
  121. window-copy.c
  122. window-tree.c
  123. window.c
  124. xmalloc.c
  125. xmalloc.h
  126. xterm-keys.c