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

Resize #39819

Merged
merged 28 commits into from
Apr 29, 2024
Merged

Resize #39819

Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b7d62ed
Resize
probakowski Feb 7, 2024
72c4ba4
???
probakowski Feb 21, 2024
fc064c2
???
probakowski Feb 25, 2024
5e2489c
Fixes to compile
Mar 1, 2024
7c2e866
Updates to latest IronRDP with dvc fix, cleans up some of the debug code
Mar 8, 2024
e259dbd
Hooks up resize listener on the client and sends changes as ClientScr…
Mar 8, 2024
8ad9b63
Handles the new DeactivateAll ProcessorOutput
Mar 11, 2024
7f262aa
hooks up client_write_screen_resize
Mar 12, 2024
ce2ffa7
Renames tdp Connection Initialized to Connection Activated
Mar 12, 2024
983d7cf
Switch monitor orientation based on width/height
Mar 12, 2024
5737054
remove superfluous canvas size sync
Mar 13, 2024
f5ffe83
Updates to the most up-to-date hash for IronRDP (not merged to master…
Mar 20, 2024
ad84d37
Updates to the most recent hash for IronRDP feat/dynamic-resize
Mar 20, 2024
b21da76
Adds a mechanism to withhold sending resize requests to the RDP serve…
Mar 26, 2024
f2f12fb
Merge branch 'master' into isaiah/resize
Mar 26, 2024
6bde80b
Refactoring after update to the tip of https://github.com/Devolutions…
Mar 26, 2024
6ce36b0
Adds windowOnResize to story
Mar 27, 2024
f6b65de
adds Determine Toolchain Versions and cache paths and Print versions …
Mar 27, 2024
42dc720
fixes debug log formatting
Apr 1, 2024
90380c3
Updates to local IronRDP and later IronRDP api
Apr 19, 2024
d37f2b8
Merge branch 'master' into isaiah/resize
Apr 24, 2024
d5c5112
updates to IronRDP latest rev on https://github.com/Devolutions/IronR…
Apr 25, 2024
638b611
reverting mistaken changes
Apr 25, 2024
88cdb84
throttle -> debounce and naming changes
Apr 25, 2024
0ecbf48
js renamings
Apr 26, 2024
63e463d
Merge branch 'master' into isaiah/resize
Apr 26, 2024
233f60c
Merge branch 'master' into isaiah/resize
Apr 29, 2024
e5efaeb
updates to IronRDP master
Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 29 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 14 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ codegen-units = 1
[workspace.dependencies]
# Note: To use a local IronRDP repository as a crate (for example, ironrdp-cliprdr), define the dependency as follows:
# ironrdp-cliprdr = { path = "/path/to/local/IronRDP/crates/ironrdp-cliprdr" }
# This rev hash corresponds to https://github.com/Devolutions/IronRDP/pull/436. It is being merged while that PR is
# still open in IronRDP in order to get these changes into a release, however it should be updated once that PR is
# merged. In the meantime, no other IronRDP hash's (without these changes) should be used.
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275", features = ["rustls"]}
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "49dab7d8df4bd785bf17fce97ac02beaba0b0275" }
# This rev hash is for testing purposes only. It should NOT be merged, and should be updated to IronRDP master once
# https://github.com/Devolutions/IronRDP/pull/430 and https://github.com/Devolutions/IronRDP/pull/436 are merged.
ironrdp-cliprdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-displaycontrol = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-dvc = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b", features = ["rustls"]}
ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "a40adbbe542033e7561722067fc705704783e66b" }
4 changes: 4 additions & 0 deletions lib/srv/desktop/rdp/rdpclient/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ ironrdp-rdpdr.workspace = true
ironrdp-rdpsnd.workspace = true
ironrdp-session.workspace = true
ironrdp-svc.workspace = true
ironrdp-dvc.workspace = true
ironrdp-displaycontrol.workspace = true
ironrdp-tls.workspace = true
ironrdp-tokio.workspace = true
iso7816 = "0.1.2"
Expand All @@ -36,6 +38,8 @@ tokio = { version = "1.37", features = ["full"] }
tokio-boring = { git = "https://github.com/gravitational/boring", rev="605253d99d5e363e178bcf97e1d4622e33844cd5", optional = true }
utf16string = "0.2.0"
uuid = { version = "1.8.0", features = ["v4"] }
tracing-subscriber = "0.3.17"
ibeckermayer marked this conversation as resolved.
Show resolved Hide resolved
tracing = { version = "0.1", features = ["log-always" ] }

[build-dependencies]
cbindgen = "0.26.0"
Expand Down
21 changes: 15 additions & 6 deletions lib/srv/desktop/rdp/rdpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,15 @@ func (c *Client) startInputStreaming(stopCh chan struct{}) error {
c.UpdateClientActivity()

switch m := msg.(type) {
case tdp.ClientScreenSpec:
c.cfg.Logger.DebugContext(context.Background(), "Client changed screen size", "width", m.Width, "height", m.Height)
if errCode := C.client_write_screen_resize(
C.ulong(c.handle),
C.uint32_t(m.Width),
C.uint32_t(m.Height),
); errCode != C.ErrCodeSuccess {
return trace.Errorf("ClientScreenSpec: client_write_screen_resize: %v", errCode)
}
case tdp.MouseMove:
mouseX, mouseY = m.X, m.Y
if errCode := C.client_write_rdp_pointer(
Expand Down Expand Up @@ -694,8 +703,8 @@ func (c *Client) handleRDPFastPathPDU(data []byte) C.CGOErrCode {
return C.ErrCodeSuccess
}

//export cgo_handle_rdp_connection_initialized
func cgo_handle_rdp_connection_initialized(
//export cgo_handle_rdp_connection_activated
func cgo_handle_rdp_connection_activated(
handle C.uintptr_t,
io_channel_id C.uint16_t,
user_channel_id C.uint16_t,
Expand All @@ -706,17 +715,17 @@ func cgo_handle_rdp_connection_initialized(
if err != nil {
return C.ErrCodeFailure
}
return client.handleRDPConnectionInitialized(io_channel_id, user_channel_id, screen_width, screen_height)
return client.handleRDPConnectionActivated(io_channel_id, user_channel_id, screen_width, screen_height)
}

func (c *Client) handleRDPConnectionInitialized(ioChannelID, userChannelID, screenWidth, screenHeight C.uint16_t) C.CGOErrCode {
c.cfg.Logger.DebugContext(context.Background(), "Received RDP channel IDs", "io_channel", ioChannelID, "user_channel", userChannelID)
func (c *Client) handleRDPConnectionActivated(ioChannelID, userChannelID, screenWidth, screenHeight C.uint16_t) C.CGOErrCode {
c.cfg.Logger.DebugContext(context.Background(), "Received RDP channel IDs", "io_channel_id", ioChannelID, "user_channel_id", userChannelID)

// Note: RDP doesn't always use the resolution we asked for.
// This is especially true when we request dimensions that are not a multiple of 4.
c.cfg.Logger.DebugContext(context.Background(), "RDP server provided resolution", "width", screenWidth, "height", screenHeight)

if err := c.cfg.Conn.WriteMessage(tdp.ConnectionInitialized{
if err := c.cfg.Conn.WriteMessage(tdp.ConnectionActivated{
IOChannelID: uint16(ioChannelID),
UserChannelID: uint16(userChannelID),
ScreenWidth: uint16(screenWidth),
Expand Down
Loading
Loading