FreeRDP icon indicating copy to clipboard operation
FreeRDP copied to clipboard

fix moving a window shrinks it 14x7 when connect to server 2019

Open 2fly2 opened this issue 3 years ago • 8 comments

problem: when connect to app C:\Windows\system32\win32calc.exe on server 2019, every time we move the window, it shrinks. root cause: when local move end, we send Client Window Move PDU with incorrect window resize margin.

bug as reference doc MS-RDPERP 1.3.2.5 RAIL Local Move/Resize: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-rdperp/348a2e91-3ea5-415d-ad67-348d96c3f1bd

" Finally, when the user is done with the move/resize, the local RAIL window receives this notification and forwards a mouse button-up to the server to end move/size on the server. For keyboard-based moves and all resize operations, the client also sends a Client Window Move PDU (section 2.2.2.7.4) to the server to inform the server of the window's new position and size. (For mouse-based moves, the mouse button-up is sufficient to inform the window's final position). "

It is redundant to send Client Window Move PDU if we end a mouse-based move.

2fly2 avatar Jul 20 '22 07:07 2fly2

Can one of the admins verify this patch?

freerdp-bot avatar Jul 20 '22 07:07 freerdp-bot

@freerdp-bot can you test please ?

hardening avatar Jul 21 '22 17:07 hardening

Refer to this link for build results (access rights to CI server needed): https://ci.freerdp.com//job/PullRequestTester/7832/

freerdp-bot avatar Jul 21 '22 17:07 freerdp-bot

@2fly2 pleaes use clang-format to apply correct formatting to your PR

mfleisz avatar Jul 22 '22 07:07 mfleisz

Excuse me, do I understand right that this PR is a continuation for https://github.com/FreeRDP/FreeRDP/pull/7885, i.e. the implementation of TODO (present at the link):

TODO: this pull request only fix window that is resizable(mspaint), because server only send resize margins for resizable window(MS-RDPERP 3.2.5.1.6). other window(calc) still shrinks when move, we can caculate resize margins from window size change, because the only reason of size change is client window move pdu, i will open another pull request when test ok.

I have checked if it fixes the problem for non-resizable windows, e.g. for mstsc and for Qt pop-up message boxes of an app. But, alas, it does not fix the problem: the windows are still shrinking, when moved around the screen, or even are moving to the right border of the screen by themselves. Or do I misunderstand anything?

@2fly2

ZhenyaKh avatar Aug 05 '22 06:08 ZhenyaKh

@freerdp-bot test

mfleisz avatar Aug 05 '22 06:08 mfleisz

Refer to this link for build results (access rights to CI server needed): https://ci.freerdp.com//job/PullRequestTester/7850/

freerdp-bot avatar Aug 05 '22 06:08 freerdp-bot

Excuse me, do I understand right that this PR is a continuation for #7885, i.e. the implementation of TODO (present at the link):

TODO: this pull request only fix window that is resizable(mspaint), because server only send resize margins for resizable window(MS-RDPERP 3.2.5.1.6). other window(calc) still shrinks when move, we can caculate resize margins from window size change, because the only reason of size change is client window move pdu, i will open another pull request when test ok.

I have checked if it fixes the problem for non-resizable windows, e.g. for mstsc and for Qt pop-up message boxes of an app. But, alas, it does not fix the problem: the windows are still shrinking, when moved around the screen, or even are moving to the right border of the screen by themselves. Or do I misunderstand anything?

@2fly2

yes, this PR is a continuation for https://github.com/FreeRDP/FreeRDP/pull/7885, and not fix shrinking totally. the root cause of shrinking is that client send Client Window Move PDU with wrong window resize margin. th PR just prevent send unnecessary Client Window Move PDU if we end a mouse-based move, which 100% cause shrinking when we have wrong window resize margin.

@ZhenyaKh

2fly2 avatar Aug 05 '22 08:08 2fly2

@2fly2 looks good now - could you just squash the two commits into a single one?

mfleisz avatar Aug 16 '22 08:08 mfleisz