Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply latest consecutive resize, not earliest. #1019

Merged
merged 1 commit into from
Feb 10, 2019

Conversation

peadar
Copy link
Contributor

@peadar peadar commented Jan 4, 2019

If there are consecutive resize events in the userstream to be applied in
"serve", we should apply the last/latest one in the sequence, not the
first/earliest one.

This fixes a problem where a flurry of resize events (eg, generated
by a window manager resizing the client), can cause mosh to have an
out-of-date idea as to what the physical geometry of the window is.

If there are consecutive resize events in the userstream to be applied in
"serve", we should apply the last/latest one in the sequence, not the
first/earliest one.

This fixes a problem where a flurry of resize events (eg, generated
by a window manager resizing the client), can cause mosh to have an
out-of-date idea as to what the physical geometry of the window is.
Copy link
Member

@andersk andersk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took a moment to see what had changed here, but you’re right—the problem with the old code was that it updated i without updating action. Nice find!

@cgull
Copy link
Member

cgull commented Jan 7, 2019

Ouch, this is a little embarrassing, especially since there's a test for that in the build.

@peadar, exactly how did you provoke this bug? I've not seen it, and I'd like to try and reproduce it and see if I can improve src/tests/window-resize.test. (Or, be my guest and do so yourself.)

@peadar
Copy link
Contributor Author

peadar commented Jan 7, 2019

I can look at doing an automated test, but I have a utility that moves windows around an X11 display from the command line, and that's how I noticed ( http://github.com/peadar/fling ). I distilled a few pieces to make it easier to repro here: https://github.com/peadar/x11-resize-test (You'll need development libs for X11 to compile)

If you connect to a mosh server with a few milliseconds latency in one window, and from another build this, run "./test -p", and click on the mosh server window, it'll rapidly flap the size between 1/2 and 1/4 of the original, and then restore it. For me, the mosh server shell has the wrong window size at the end, as reported by 'stty -a'

@cgull
Copy link
Member

cgull commented Jan 8, 2019

Thanks! Yes, I can reproduce this now on a FreeBSD 12.0 client with X11, KDE5 and Konsole. My first attempt reproducing it with tmux fails, but I'll look at that some more.

@andersk
Copy link
Member

andersk commented Feb 10, 2019

It turns out I run into this reliably by maximizing or unmaximizing GNOME Terminal (on GNOME Shell, Wayland, Ubuntu 19.04)—apparently that generates multiple resizes at once. I’ve confirmed this fix. I’m not sure if we’re waiting for better tests to merge this, but that can always be done later.

@andersk andersk merged commit c3a2756 into mobile-shell:master Feb 10, 2019
@eminence eminence added this to the 1.4.0 milestone Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants