diff --git a/Cargo.lock b/Cargo.lock index 2ea04fdaf7d..8a02ea439e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1225,7 +1225,7 @@ dependencies = [ [[package]] name = "ironrdp-async" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bytes", "ironrdp-connector", @@ -1236,7 +1236,7 @@ dependencies = [ [[package]] name = "ironrdp-cliprdr" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bitflags 2.5.0", "ironrdp-pdu", @@ -1248,7 +1248,7 @@ dependencies = [ [[package]] name = "ironrdp-connector" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "ironrdp-error", "ironrdp-pdu", @@ -1263,7 +1263,7 @@ dependencies = [ [[package]] name = "ironrdp-dvc" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "ironrdp-pdu", "ironrdp-svc", @@ -1274,12 +1274,12 @@ dependencies = [ [[package]] name = "ironrdp-error" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" [[package]] name = "ironrdp-graphics" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bit_field", "bitflags 2.5.0", @@ -1296,7 +1296,7 @@ dependencies = [ [[package]] name = "ironrdp-pdu" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bit_field", "bitflags 2.5.0", @@ -1318,7 +1318,7 @@ dependencies = [ [[package]] name = "ironrdp-rdpdr" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bitflags 2.5.0", "ironrdp-error", @@ -1330,7 +1330,7 @@ dependencies = [ [[package]] name = "ironrdp-rdpsnd" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "ironrdp-pdu", "ironrdp-svc", @@ -1339,7 +1339,7 @@ dependencies = [ [[package]] name = "ironrdp-session" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "ironrdp-connector", "ironrdp-dvc", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "ironrdp-svc" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bitflags 2.5.0", "ironrdp-pdu", @@ -1362,7 +1362,7 @@ dependencies = [ [[package]] name = "ironrdp-tls" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "tokio", "tokio-rustls", @@ -1372,7 +1372,7 @@ dependencies = [ [[package]] name = "ironrdp-tokio" version = "0.1.0" -source = "git+https://github.com/Devolutions/IronRDP?rev=e5bd2beab54bee2cf173cc110a804df2e709a1ac#e5bd2beab54bee2cf173cc110a804df2e709a1ac" +source = "git+https://github.com/Devolutions/IronRDP?rev=49dab7d8df4bd785bf17fce97ac02beaba0b0275#49dab7d8df4bd785bf17fce97ac02beaba0b0275" dependencies = [ "bytes", "ironrdp-async", diff --git a/Cargo.toml b/Cargo.toml index 29b933c7f71..b35823cfae0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,13 +26,13 @@ codegen-units = 1 # 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 = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-connector = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-graphics = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-pdu = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-rdpdr = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-rdpsnd = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-session = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-svc = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } -ironrdp-tls = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac", features = ["rustls"]} -ironrdp-tokio = { git = "https://github.com/Devolutions/IronRDP", rev = "e5bd2beab54bee2cf173cc110a804df2e709a1ac" } +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" } diff --git a/lib/srv/desktop/rdp/rdpclient/src/client.rs b/lib/srv/desktop/rdp/rdpclient/src/client.rs index 378fc2505f8..a423222daa5 100644 --- a/lib/srv/desktop/rdp/rdpclient/src/client.rs +++ b/lib/srv/desktop/rdp/rdpclient/src/client.rs @@ -1169,6 +1169,7 @@ fn create_config(params: &ConnectParams, pin: String) -> Config { autologon: true, pointer_software_rendering: false, performance_flags: PerformanceFlags::default() + | PerformanceFlags::DISABLE_CURSOR_SHADOW // this is required for pointer to work correctly in Windows 2019 | if !params.show_desktop_wallpaper { PerformanceFlags::DISABLE_WALLPAPER } else { diff --git a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx index a03c1e05bc5..7834f0e232f 100644 --- a/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx +++ b/web/packages/teleport/src/components/TdpClientCanvas/TdpClientCanvas.tsx @@ -99,8 +99,6 @@ function TdpClientCanvas(props: Props) { } }, [client, clientOnPngFrame]); - const previousCursor = useRef('auto'); - useEffect(() => { if (client && updatePointer) { const canvas = canvasRef.current; @@ -110,20 +108,29 @@ function TdpClientCanvas(props: Props) { hotspot_y?: number; }) => { if (typeof pointer.data === 'boolean') { - if (pointer.data) { - canvas.style.cursor = previousCursor.current; - } else { - previousCursor.current = canvas.style.cursor; - canvas.style.cursor = 'none'; - } + canvas.style.cursor = pointer.data ? 'default' : 'none'; return; } - const cursor = document.createElement('canvas'); + let cursor = document.createElement('canvas'); cursor.width = pointer.data.width; cursor.height = pointer.data.height; cursor .getContext('2d', { colorSpace: pointer.data.colorSpace }) .putImageData(pointer.data, 0, 0); + if (pointer.data.width > 32 || pointer.data.height > 32) { + // scale the cursor down to at most 32px - max size fully supported by browsers + const resized = document.createElement('canvas'); + let scale = Math.min(32 / cursor.width, 32 / cursor.height); + resized.width = cursor.width * scale; + resized.height = cursor.height * scale; + + let context = resized.getContext('2d', { + colorSpace: pointer.data.colorSpace, + }); + context.scale(scale, scale); + context.drawImage(cursor, 0, 0); + cursor = resized; + } canvas.style.cursor = `url(${cursor.toDataURL()}) ${ pointer.hotspot_x } ${pointer.hotspot_y}, auto`;