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

Ignore screen size changes which don't change anything #203

Merged
merged 3 commits into from
Jul 30, 2022

Conversation

matt335672
Copy link
Member

As a result of investigating neutrinolabs/xrdp#1928, it was discovered that that when mstsc.exe has a single monitor session full-screen, and this session is moved to another monitor and made full-screen, mstsc.exe sends two seemingly identical DISPLAYCONTROL_MONITOR_LAYOUT_PDUs for the new screen size in quick succession.

This behaviour was observed on mstsc.exe version 10.0.19041.1266. This doesn't seem to be necessary, but we need to deal with it.

[MS-RDPEDISP] has nothing to say on this, except that the server should react to valid messages.

In practice, what happens is that the two messages cause xorgxrdp to reallocate the shared memory area twice. Between the first allocation and the second allocation, an update is send to xup with the id of the first shared memory area. If xup does not process this mesage until after the second area has been allocated, xup fails to connect to the shared memory area, and xrdp exits.

See also neutrinolabs/xrdp#2065 which attempts to improve xrdp logging in this area.

This PR deals with the above situation by only reallocating the shared memory area if it differs in size from the previous area. In use cases like that mentioned in neutrinolabs/xrdp#1928, where a single-monitor session is moved from one monitor to a monitor of the same resolution, this reallocation will be unnecessary anyway.

@Nexarian - I'd very much appreciate your comments on this, particularly as to whether this is the right way to deal with this. I'll be happy to answer any questions you might have.

@matt335672
Copy link
Member Author

After some more testing with RFX, I've found a other places where a similar thing can happen.

I've updated the PR to simply reallocate the shared memory area only if the size has changed.

This change introduces some refactoring along the lines of #200. It doesn't however implement the additional logging of that PR.

@Nexarian
Copy link
Contributor

@matt335672 This seems like a win to me, but let's make sure we put neutrinolabs/xrdp#1928 to bed before we merge this.

Refactor -- Update name and reduce nesting.
@Nexarian Nexarian merged commit a16c436 into neutrinolabs:devel Jul 30, 2022
metalefty pushed a commit to metalefty/xorgxrdp that referenced this pull request Sep 6, 2022
)

* Only reallocate shared memory if the size changes
Co-authored-by: Nexarian <cmp@pitstick.net>
metalefty added a commit that referenced this pull request Sep 7, 2022
[v0.9] Ignore screen size changes which don't change anything (#203)
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.

2 participants