13 | | Please, do not steal existing bug reports. |
14 | | Pavel Tsekov <ptsekov> |
15 | | Project Administrator |
16 | | Mon 01 Oct 2007 09:03:01 PM UTC, comment #9: |
| 19 | Unfortunately mc is unable to properly handle when the terminal is |
| 20 | resized opaquely. It receives tons of resize events (sigwinch), |
| 21 | most likely ignores the new ones while processing an older one. |
| 22 | Quite often when I finish resizing my window, mc draws its panels |
| 23 | with a different size. Hence if I enlarge my terminal, I might get |
| 24 | black columns/rows on its right/bottom part. If I shrink the |
| 25 | window, the whole screen can be garbled. |
18 | | when a resize is sent before mc is completely up, it doesn't get |
19 | | the geometry right, either - and yes, this happens about every time |
20 | | an xterm -e mc is restored by session management on my system. so |
21 | | the signal handler should be set up before the initial geometry is |
22 | | queried. |
23 | | Oswald Buddenhagen <ossi> |
24 | | Mon 01 Oct 2007 03:21:44 PM UTC, comment #8: |
| 27 | Then when I press one key, or click somewhere in the terminal with |
| 28 | the mouse, suddenly mc's screen is repainted with the right size, |
| 29 | and everything goes on perfectly. |
32 | | Tested on 4.6.2-pre1. |
33 | | Denis Vlasenko <vda> |
34 | | Wed 08 Nov 2006 01:38:24 PM UTC, comment #7: |
35 | | |
36 | | Committed. Quite an improvement in behaviour. Thank you. |
37 | | Leonard den Ottolander <leonardjo> |
38 | | Project Member |
39 | | Mon 06 Nov 2006 10:24:35 PM UTC, comment #6: |
40 | | |
41 | | As I understand your patch/hack, eliminating the timeouts on a |
42 | | window resize event significantly reduces the chance mc is still |
43 | | waiting inside the get_event() loop when a new resize event occurs. |
44 | | Leonard den Ottolander <leonardjo> |
45 | | Project Member |
46 | | Mon 06 Nov 2006 12:01:58 PM UTC, comment #5: |
47 | | |
48 | | Please commit it if it seems to be okay for you (I've been using mc |
49 | | 4.6.1 with this patch for a month, and found no side effects, while |
50 | | it makes mc much better when resizing the terminal). But please |
51 | | don't yet close this bugreport to remind us that a proper fix is |
52 | | still needed. This patch only makes it much better, but still |
53 | | there's a small chance for the bug to appear. Until we have |
54 | | a proper fix, it's good to apply a temporary hack to heavily |
55 | | decrease the chance for the bug. |
56 | | Egmont Koblinger <egmont> |
57 | | Fri 03 Nov 2006 07:14:55 PM UTC, comment #4: |
58 | | |
59 | | Shall I commit this patch or should I wait for the piped version? |
60 | | Leonard den Ottolander <leonardjo> |
61 | | Project Member |
62 | | Tue 10 Oct 2006 04:22:16 PM UTC, comment #3: |
63 | | |
64 | | Added a resize.patch. This does not suffer from the new bug, though |
65 | | I don't understand what made a difference. |
66 | | |
67 | | Still a rewrite to using pipes is needed to fill a minor race condition. |
68 | | Egmont Koblinger <egmont> |
69 | | Tue 10 Oct 2006 03:40:51 PM UTC, comment #2: |
70 | | |
71 | | Oh, I just found the pselect() call which is supposed to solve this |
72 | | problem. However, its manpage says the Linux kernel supports this |
73 | | only since 2.6.16 which is a quite new piece. It says that glibc |
74 | | had an emulation which is vulnerable to the race condition I just |
75 | | mentioned and pselect was just introduced for. |
76 | | The manpage also mentions and recommends the self-pipe trick which |
77 | | is more portable. |
78 | | Egmont Koblinger <egmont> |
79 | | Tue 10 Oct 2006 03:27:46 PM UTC, comment #1: |
80 | | |
| 37 | Comment 1 by Egmont Koblinger <egmont> at Tue 10 Oct 2006 03:27:46 PM UTC: |
| 38 | {{{ |
132 | | Egmont Koblinger <egmont> |
133 | | Fri 22 Sep 2006 01:04:44 PM UTC, original submission: |
134 | | |
135 | | Modern desktop environments and window managers usually resize the |
136 | | windows in an opaque way: plenty of resize events are sent to the |
137 | | application while the edge of the window is being dragged. This |
138 | | gives users a much better feedback than the ancient method (only |
139 | | showing where the edges of the window will be, and resizing when |
140 | | the mouse button is released), though it definitely requires much |
141 | | more cpu resources. |
142 | | |
143 | | Unfortunately mc is unable to properly handle when the terminal is |
144 | | resized opaquely. It receives tons of resize events (sigwinch), |
145 | | most likely ignores the new ones while processing an older one. |
146 | | Quite often when I finish resizing my window, mc draws its panels |
147 | | with a different size. Hence if I enlarge my terminal, I might get |
148 | | black columns/rows on its right/bottom part. If I shrink the |
149 | | window, the whole screen can be garbled. |
150 | | |
151 | | Then when I press one key, or click somewhere in the terminal with |
152 | | the mouse, suddenly mc's screen is repainted with the right size, |
153 | | and everything goes on perfectly. |
154 | | |
155 | | It would be nice to eliminate these race conditions and make mc |
156 | | resize correctly to the final terminal size, no matter how many |
157 | | resize events were sent in a very short time. |
160 | | Bonus (reported in #368): if you start mc in an xterm and resize the terminal before mc shows the panels, it will not be adjusted to the terminal's size until you resize again once the panels are there. |
| 92 | Comment 2 by Egmont Koblinger <egmont> at Tue 10 Oct 2006 03:40:51 PM UTC: |
| 93 | {{{ |
| 94 | Oh, I just found the pselect() call which is supposed to solve this |
| 95 | problem. However, its manpage says the Linux kernel supports this |
| 96 | only since 2.6.16 which is a quite new piece. It says that glibc |
| 97 | had an emulation which is vulnerable to the race condition I just |
| 98 | mentioned and pselect was just introduced for. |
| 99 | The manpage also mentions and recommends the self-pipe trick which |
| 100 | is more portable. |
| 101 | }}} |
| 102 | |
| 103 | Comment 3 by Egmont Koblinger <egmont> at Tue 10 Oct 2006 04:22:16 PM UTC: |
| 104 | {{{ |
| 105 | Added a resize.patch. This does not suffer from the new bug, though |
| 106 | I don't understand what made a difference. |
| 107 | |
| 108 | Still a rewrite to using pipes is needed to fill a minor race condition. |
| 109 | }}} |
| 110 | |
| 111 | Comment 4 by Leonard den Ottolander <leonardjo> at Fri 03 Nov 2006 07:14:55 PM UTC: |
| 112 | {{{ |
| 113 | Shall I commit this patch or should I wait for the piped version? |
| 114 | }}} |
| 115 | |
| 116 | Comment 5 by Egmont Koblinger <egmont> at Mon 06 Nov 2006 12:01:58 PM UTC: |
| 117 | {{{ |
| 118 | Please commit it if it seems to be okay for you (I've been using mc |
| 119 | 4.6.1 with this patch for a month, and found no side effects, while |
| 120 | it makes mc much better when resizing the terminal). But please |
| 121 | don't yet close this bugreport to remind us that a proper fix is |
| 122 | still needed. This patch only makes it much better, but still |
| 123 | there's a small chance for the bug to appear. Until we have |
| 124 | a proper fix, it's good to apply a temporary hack to heavily |
| 125 | decrease the chance for the bug. |
| 126 | }}} |
| 127 | |
| 128 | Comment 6 by Leonard den Ottolander <leonardjo> at Mon 06 Nov 2006 10:24:35 PM UTC: |
| 129 | {{{ |
| 130 | As I understand your patch/hack, eliminating the timeouts on a |
| 131 | window resize event significantly reduces the chance mc is still |
| 132 | waiting inside the get_event() loop when a new resize event occurs. |
| 133 | }}} |
| 134 | |
| 135 | Comment 7 by Leonard den Ottolander <leonardjo> at Wed 08 Nov 2006 01:38:24 PM UTC: |
| 136 | {{{ |
| 137 | Committed. Quite an improvement in behaviour. Thank you. |
| 138 | }}} |
| 139 | |
| 140 | Comment 8 by Denis Vlasenko <vda> at Mon 01 Oct 2007 03:21:44 PM UTC: |
| 141 | {{{ |
| 142 | If you run without mouse support (mc -d), mc doesn't detect resizes. |
| 143 | |
| 144 | You need to press a key for mc to resize itself to new window after |
| 145 | window is maximized or resized (press up/down arrow, Ctrl-O, almost |
| 146 | anything will work). |
| 147 | |
| 148 | Tested on 4.6.2-pre1. |
| 149 | }}} |
| 150 | |
| 151 | Comment 9 by Oswald Buddenhagen <ossi> at Mon 01 Oct 2007 09:03:01 PM UTC: |
| 152 | {{{ |
| 153 | when a resize is sent before mc is completely up, it doesn't get |
| 154 | the geometry right, either - and yes, this happens about every time |
| 155 | an xterm -e mc is restored by session management on my system. so |
| 156 | the signal handler should be set up before the initial geometry is |
| 157 | queried. |
| 158 | }}} |
| 159 | |
| 160 | Comment 10 by Pavel Tsekov <ptsekov> at Tue 02 Oct 2007 09:18:19 AM UTC: |
| 161 | {{{ |
| 162 | Please, do not steal existing bug reports. |
| 163 | }}} |