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

[v0.10] Fixes some problems with monitor hotplug #2951

Merged
merged 12 commits into from
Feb 20, 2024

Commits on Feb 20, 2024

  1. Fixes some problems with monitor hotplug

    This fixes some monitor hotplug issues with non-GFX codepaths.
    
    1) The server_version_message() was working on an out-of-date
       copy of the client_info. As a result, the X server and the
       window manager did not agree on the number of windows
    2) As a result of 1), a memory leak was found in the VNC module.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    e002361 View commit details
    Browse the repository at this point in the history
  2. Fix sending of monitor layout PDU

    From [MS-RCPBCGR] 3.3.5.12.1:-
    
    > ...The contents of this PDU SHOULD NOT be compressed.
    >
    > This PDU MUST NOT be sent to a client that has not indicated support for
    > it by setting the RNS_UD_CS_SUPPORT_MONITOR_LAYOUT_PDU flag (0x0040)
    > in the earlyCapabilityFlags field of the Client Core Data (section
    > 2.2.1.3.2).
    
    Also, 2.2.12.1 specifies the source channel must be zero.
    
    In testing, a compressed monitor layout PDU causes mstsc.exe
    to exit with a protocol error.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    1917b9c View commit details
    Browse the repository at this point in the history
  3. Add a client_resize_mode field

    This stores what kind of resizing (if any) can be achieved with
    a Deactivation-Reactivation sequence.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    b0a30a3 View commit details
    Browse the repository at this point in the history
  4. Update module interfaces with new calls for resizing

    This commit DOES NOT compile.
    
    This change alters these module interface calls:-
    1) mod_server_monitor_resize() (Call from xrdp to module). Updated.
    2) server_reset() (Call from module to xrdp). Replaced.
    
    The mod_server_monitor_resize() call is updated :-
    1) to allow a monitor list to be passed in for a multimon resize
    2) with an 'in_progress' return value which tells the caller whether or
       not to expect a callback.
    
    The server_reset() call served two purposes up until now:-
    1) To allow a module to resize a single monitor session. There
       is no way to request a multi-monitor resize from the module
    2) (with bpp == 0) To signal to the mm resize state machine that
       a server screen resize hsa finished.
    
    This is split into two calls:-
    1) client_monitor_resize() to allow a mdule to request a
       multimon resize.
    2) server_monitor_resize_done(). This is called by a module
       when a resize is completed.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    bfecd18 View commit details
    Browse the repository at this point in the history
  5. Update neutrinordp module

    Neutrinordp module now compiles with updated monitor resize
    interface
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    dc6ac97 View commit details
    Browse the repository at this point in the history
  6. Update VNC module resize functionality

    Significant updates for the VNC module:-
    1) Support for the new API calls allowing both server and client
       multi-monitor resizes.
    2) The s member variable of the vnc_screen_layout structure is no longer
       dynamically allocated.
    3) The module server_width and server_height member variables are
       removed as these are just duplicating server_layout.total_width and
       server_layout.total_height.
    4) When the server screens are resized, there is no need to restart the
       entire resize state machine as we already know at this point that
       the server supports resizing.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    9f422cc View commit details
    Browse the repository at this point in the history
  7. Change to the XUP module for the new resizing interface

    Input message 300 to xorgxrdp which communicated a screen size
    has been replaced with message 302 which sends a list of monitors
    to xorgxrdp. This simplifies the initialisation and resize logic
    somewhat, but a compatible version of xorgxrdp must be used
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    66a8e93 View commit details
    Browse the repository at this point in the history
  8. Rework xrdp to support new module resize interface

    This commit compiles.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    74c2f7c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ee37eb2 View commit details
    Browse the repository at this point in the history
  10. Prevent EGFX drawing while channel is down

    Clear egfx_up as soon as the channel starts to close so that
    xrdp_mm_draw_dirty() doesn't send data to a closed channel.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    355a71f View commit details
    Browse the repository at this point in the history
  11. Clear memory allocated to resized bitmaps

    This prevents valgrind errors when resizing the screen to
    a larger size on GFX systems.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    ab698c3 View commit details
    Browse the repository at this point in the history
  12. GFX: Prevent MM screen being written to the client

    In GFX mode, if we're using xorgxrdp, frame updates are send directly
    from the client, bypassing the screen buffer in xrdp_mm.
    
    This commit only allows the xrdp_mm screen buffer to be invalidated
    if the painter has drawn into it since the module was loaded. This
    prevents the unused (and invalid) frame buffer being pushed to the client
    in GFX mode with xorgxrdp.
    matt335672 authored and metalefty committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    d769b40 View commit details
    Browse the repository at this point in the history