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

Block resize if already this size. #2300

Merged

Conversation

Nexarian
Copy link
Contributor

@Nexarian Nexarian commented Jul 2, 2022

While this feature is part of other branches for testing EGFX
integration, it somehow never made it into devel. This should fix

#1928, for real this time!

@metalefty
Copy link
Member

I'll test this on Wednesday.

@matt335672
Copy link
Member

The code looks fine to me, but does this cope with situations where a monitor is moved but the overall session size doesn't change?

Example; Three monitors in a row with the left one and right one being 1280x1024 and the middle one being 1024x768.

If the user starts with an arrangement like like this:-

+------------+ +---+ +------------+
|            | |   | |            |
|            | +---+ |            |
|            |       |            |
+------------+       +------------+

Session size is (1280 + 1024 + 1280) x 1024 = 3584 x 1024

If the user then just moves the middle monitor down:-

+------------+       +------------+
|            |       |            |
|            | +---+ |            |
|            | |   | |            |
+------------+ +---+ +------------+

we'll get a message to say the layout's changed, but I think we'll just ignore it in this case, as the session size is still 3584 x 1024.

@Nexarian
Copy link
Contributor Author

Nexarian commented Jul 4, 2022

@matt335672 That makes sense. The question I might have is: If the only thing that changes is the layout, and the total session size doesn't change, what is there for us to do about it? The only thing I can think of is that this code block should be executed essentially no matter what. We don't do the mechanics of resizing anything, but we can say "ok, we've updated the internal monitor layout."

Is there anything else you can think of here? I confess my understanding of how multiple monitors in RDP is supposed to work is still hazy.

I also noticed this: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdpedisp/32525e02-fc5c-4b82-ae87-88a458444902:

  • None of the specified monitors overlap.
  • Each monitor is adjacent to at least one other monitor (even if only at a single point).

We're not error-checking for those use-cases as of yet, should probably add that.

@Nexarian
Copy link
Contributor Author

Nexarian commented Jul 4, 2022

This ancient post seems to show what Microsoft is thinking here: https://techcommunity.microsoft.com/t5/security-compliance-and-identity/using-multiple-monitors-in-remote-desktop-session/ba-p/246840

Though it's old, I have no reason to believe the fundamentals haven't changed. What I struggle to find is more up to date documentation and/or an actual protocol example of how this is supposed to work.

Copy link
Member

@matt335672 matt335672 left a comment

Choose a reason for hiding this comment

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

As discussed, if session size changes, layout updates should be recorded. Once that's done, merge away!

@metalefty
Copy link
Member

It might not be related to this fix. I got another protocol error while testing.

After 3 times move window to another display and fullscreenify, I got the following error.

image

[20220706-10:52:22] [DEBUG] dynamic_monitor_data: msg_type 2 msg_length 56
[20220706-10:52:22] [DEBUG] libxrdp_process_monitor_stream: The number of monitors received is: 1
[20220706-10:52:24] [DEBUG] dynamic_monitor_data: msg_type 2 msg_length 56
[20220706-10:52:24] [DEBUG] libxrdp_process_monitor_stream: The number of monitors received is: 1
[20220706-10:52:24] [WARN ] process_dynamic_monitor_description: Not resizing. Already this size. (w: 2560 x h: 1440)
[20220706-10:52:24] [INFO ] xrdp_caps_process_pointer: client supports new(color) cursor
[20220706-10:52:25] [INFO ] xrdp_process_offscreen_bmpcache: support level 1 cache size 7864320 MB cache entries 100
[20220706-10:52:25] [INFO ] xrdp_caps_process_codecs: nscodec, codec id 1, properties len 3
[20220706-10:52:25] [WARN ] xrdp_caps_process_codecs: unknown codec id 5
[20220706-10:52:25] [INFO ] xrdp_caps_process_codecs: RemoteFX, codec id 3, properties len 49
[20220706-10:52:25] [ERROR] SSL_write: I/O error
[20220706-10:52:26] [ERROR] xrdp_sec_send_fastpath: xrdp_fastpath_send failed
[20220706-10:52:26] [ERROR] xrdp_rdp_send_fastpath: xrdp_sec_send_fastpath failed

@Nexarian
Copy link
Contributor Author

Nexarian commented Jul 6, 2022

@metalefty I think the problem is for some reason your session switched from RemoteFX to Fastpath during resize. Did you connect to an existing session that was previously using RemoteFX?

On one hand, switching encoding types on resize probably shouldn't be supported. On the other hand, we shouldn't crash either...

@metalefty
Copy link
Member

Yes, I connected to the existing session. I'll try with new session. Thanks!

@metalefty
Copy link
Member

Re-tried in new session, I confirmed the change fix the issue. Can you address @matt335672 's point?

While this feature is part of other branches for testing EGFX
integration, it somehow never made it into devel. This should fix
neutrinolabs#1928, for real this time!
@Nexarian Nexarian force-pushed the block_resize_if_already_resized branch from 669f862 to d01ce57 Compare July 8, 2022 03:32
@Nexarian Nexarian merged commit 7711978 into neutrinolabs:devel Jul 8, 2022
@Nexarian Nexarian deleted the block_resize_if_already_resized branch July 8, 2022 03:49
@metalefty
Copy link
Member

Is it possible to backport to v0.9?

@Nexarian
Copy link
Contributor Author

Nexarian commented Jul 9, 2022

@metalefty I will work on it.

@Nexarian
Copy link
Contributor Author

@metalefty I've simply incorporated this fix into #2292 because they're similar.

@metalefty
Copy link
Member

Thanks!

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.

3 participants