GUACAMOLE-288: Add support for multi-monitor connections. - #560
GUACAMOLE-288: Add support for multi-monitor connections.#560corentin-soriano wants to merge 6 commits into
Conversation
78954b5 to
d829739
Compare
8374544 to
683800f
Compare
683800f to
62c8b1e
Compare
62c8b1e to
4ee5e1b
Compare
4ee5e1b to
ac08c95
Compare
|
it will be great if we bring that to main |
Yes, that is the plan, once the code is finalized and has been fully reviewed. |
f4716ce to
1fa8ce3
Compare
afbaa06 to
d44d527
Compare
9fb030d to
7a8e74a
Compare
eda5067 to
5294c1b
Compare
|
Frequently resizing a monitor window, e.g. by using Maximize and Restore down of the window in quick succession, can cause a RDP disconnect with the following message in the guacd logs: Is it possible to wait for the flush or just discard the affected window instead of crashing the connection? |
Which version of freerdp are you using? |
|
I'm using the Dockerfile from the repository which defaults to FreeRDP 2. The exact version is |
This is potentially a bug in FreeRDP. This assertion is mandatory in version 2. |
This comment was marked as resolved.
This comment was marked as resolved.
I was able to reproduce it with one monitor with the FreeRDP 2 build. EDIT: It does not reproduce with FreeRDP 3, independent of the number of monitors. |
| /* Make json string containing monitor information */ | ||
| char json[JSON_BUFFER_SIZE]; | ||
| int pos = 0; | ||
| pos += snprintf(json + pos, JSON_BUFFER_SIZE - pos, "{"); |
There was a problem hiding this comment.
nit: While there may be concerns about grabbing an external dependency, when it comes to "never re-invent the wheel" any manual string manipulation to do json generation/parsing is king. Libraries like
https://github.com/nlohmann/json
will allow "C++ like" json parsing and generation that covers all the corner cases that JSON hides from the average user.
| } | ||
|
|
||
| /* Append monitor information to JSON string */ | ||
| pos += snprintf(json + pos, JSON_BUFFER_SIZE - pos, |
There was a problem hiding this comment.
A small piece of my soul is severed and sent to the depths of Hades every time I see sprintf generating json.
|
@necouchman @corentin-soriano |
I still have some things to finalize before we can merge. |
5294c1b to
5989c14
Compare
…hen adding a new monitor.
5989c14 to
ce23d60
Compare
Ports the reusable, protocol-agnostic multi-monitor support added upstream in apache#560 (GUACAMOLE-288) by Corentin Soriano (@corentin-soriano): * guac_user_size_handler gains per-monitor x_position/top_offset * new "multimon-layout" default-layer parameter (a JSON monitor map) * __guac_handle_size parses the new size-instruction fields * guac_rect_shrink guards against divide-by-zero Every protocol's size handler is updated to the new signature; the new per-monitor arguments are ignored by all protocols except SPICE (see the following commit), preserving existing single-monitor behavior. Original work by @corentin-soriano, adapted for this fork: apache#560
Builds on the ported libguac multi-monitor primitive to add client-driven multi-monitor support to the SPICE protocol, following the design of the RDP implementation in apache#560 (by @corentin-soriano) adapted to SPICE's model, where a QXL guest presents all heads as regions of a single combined framebuffer. * settings: new "secondary-monitors" parameter (max_secondary_monitors, default 0 = disabled) * the size handler tracks a per-monitor array (fixed, up to GUAC_SPICE_MAX_MONITORS) keyed by x_position, tiling monitors left-to-right and computing each monitor's left_offset; a non-positive size closes a secondary monitor * resize pushes the whole layout to the guest agent in a single monitors config (enabling/positioning active monitors and disabling removed ones) * on each combined-surface (re)create, the current layout is sent to the client as the "multimon-layout" parameter on the default layer so a multi-monitor client can split it into per-monitor windows * joining users are told the permitted secondary-monitor count via a "secondary-monitors" argv stream The monitor state uses a fixed array (no dynamic allocation), avoiding the pointer-ownership concerns raised in review of the upstream RDP change, and the default layer is referenced via GUAC_DEFAULT_LAYER rather than casting a guac_display_layer.
Ports the reusable, protocol-agnostic multi-monitor support added upstream in apache#560 (GUACAMOLE-288) by Corentin Soriano (@corentin-soriano): * guac_user_size_handler gains per-monitor x_position/top_offset * new "multimon-layout" default-layer parameter (a JSON monitor map) * __guac_handle_size parses the new size-instruction fields * guac_rect_shrink guards against divide-by-zero Every protocol's size handler is updated to the new signature; the new per-monitor arguments are ignored by all protocols except SPICE (see the following commit), preserving existing single-monitor behavior. Original work by @corentin-soriano, adapted for this fork: apache#560
Builds on the ported libguac multi-monitor primitive to add client-driven multi-monitor support to the SPICE protocol, following the design of the RDP implementation in apache#560 (by @corentin-soriano) adapted to SPICE's model, where a QXL guest presents all heads as regions of a single combined framebuffer. * settings: new "secondary-monitors" parameter (max_secondary_monitors, default 0 = disabled) * the size handler tracks a per-monitor array (fixed, up to GUAC_SPICE_MAX_MONITORS) keyed by x_position, tiling monitors left-to-right and computing each monitor's left_offset; a non-positive size closes a secondary monitor * resize pushes the whole layout to the guest agent in a single monitors config (enabling/positioning active monitors and disabling removed ones) * on each combined-surface (re)create, the current layout is sent to the client as the "multimon-layout" parameter on the default layer so a multi-monitor client can split it into per-monitor windows * joining users are told the permitted secondary-monitor count via a "secondary-monitors" argv stream The monitor state uses a fixed array (no dynamic allocation), avoiding the pointer-ownership concerns raised in review of the upstream RDP change, and the default layer is referenced via GUAC_DEFAULT_LAYER rather than casting a guac_display_layer.
Ports the reusable, protocol-agnostic multi-monitor support added upstream in apache#560 (GUACAMOLE-288) by Corentin Soriano (@corentin-soriano): * guac_user_size_handler gains per-monitor x_position/top_offset * new "multimon-layout" default-layer parameter (a JSON monitor map) * __guac_handle_size parses the new size-instruction fields * guac_rect_shrink guards against divide-by-zero Every protocol's size handler is updated to the new signature; the new per-monitor arguments are ignored by all protocols except SPICE (see the following commit), preserving existing single-monitor behavior. Original work by @corentin-soriano, adapted for this fork: apache#560
Builds on the ported libguac multi-monitor primitive to add client-driven multi-monitor support to the SPICE protocol, following the design of the RDP implementation in apache#560 (by @corentin-soriano) adapted to SPICE's model, where a QXL guest presents all heads as regions of a single combined framebuffer. * settings: new "secondary-monitors" parameter (max_secondary_monitors, default 0 = disabled) * the size handler tracks a per-monitor array (fixed, up to GUAC_SPICE_MAX_MONITORS) keyed by x_position, tiling monitors left-to-right and computing each monitor's left_offset; a non-positive size closes a secondary monitor * resize pushes the whole layout to the guest agent in a single monitors config (enabling/positioning active monitors and disabling removed ones) * on each combined-surface (re)create, the current layout is sent to the client as the "multimon-layout" parameter on the default layer so a multi-monitor client can split it into per-monitor windows * joining users are told the permitted secondary-monitor count via a "secondary-monitors" argv stream The monitor state uses a fixed array (no dynamic allocation), avoiding the pointer-ownership concerns raised in review of the upstream RDP change, and the default layer is referenced via GUAC_DEFAULT_LAYER rather than casting a guac_display_layer.
Allows as is to add multiple monitors of the same dimensions in RDP protocol if the server supports it.
I haven't looked at the VNC part yet.
Client side PR : apache/guacamole-client#1061
POC:
