Commit Graph

4603 Commits

Author SHA1 Message Date
rowlap
790834a947 Remove duplicate DEBUG output
allow_multimon and new_cursors are printed twice

(cherry picked from commit bf81557cdc)
2024-03-06 17:20:47 +09:00
metalefty
7700fcb1dc
Merge pull request #2957 from metalefty/v0.10-cherry-pick
[v0.10] cherry picks
2024-03-04 09:05:39 +09:00
matt335672
d6cf81a4da Increase GFX output buffer size
Size the GFX output buffer pessimistically based on the largest monitor
in the configuration.

(cherry picked from commit 90e4aca26a)
2024-03-03 10:04:28 +09:00
Koichiro Iwao
ab2430ac76 Suppress some logs when no errors
This outputs per-frame logs when using VNC backend and on login screen.

(cherry picked from commit 0b4150ff48)
2024-03-01 00:06:14 +09:00
rowlap
72d30061b0 Remove tcutils channel from xrdp.ini
According to #1943 tcutils was removed, so update the channel section to match.

(cherry picked from commit 2a0c2a612f)
2024-02-27 22:32:41 +09:00
Derek Schrock
a7115cced2 Fall back to IPv4 if IPv6 capable but don't have an IPv6 address set
When xrdp is built with IPv6 support it will only fall back to IPv4 if
IPv6 is not supported (EAFNOSUPPORT).  However, if the system is IPv6
capable but doesn't have an IPv6 address set (at least inside a FreeBSD
jail) EPROTONOSUPPORT is returned from socket().

(cherry picked from commit 5afbca4954)
2024-02-26 20:57:01 +09:00
matt335672
83f9d4ec17 GFX: Fix disconnect on resize of busy windows
When a resize is underway on a busy X server, it is possible for a
queued EGFX cmd (order #62) to be processed after the decoder has been
deleted. This causes a client disconnect with no useful error message.

(cherry picked from commit 3430b8898c)
2024-02-24 00:52:00 +09:00
matt335672
d0edde791e Migrate github actions to Node 20
Github actions are transitioning to Node 20 ans Node 16 is EOL.

https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20
(cherry picked from commit 4ba026be38)
2024-02-22 22:51:49 +09:00
Koichiro Iwao
99cf0e19f7 Bump copyright year and make easier to bump
(cherry picked from commit ae249c6755)
2024-02-22 22:51:37 +09:00
Koichiro Iwao
9b33d299d0 GFX: Relegate some logs to LOG_LEVEL_DEBUG
(cherry picked from commit 7e305f9e24)
2024-02-22 22:51:14 +09:00
metalefty
c3cb8554b6
Merge pull request #2951 from metalefty/v0.10-monitor-hotplug
[v0.10] Fixes some problems with monitor hotplug
2024-02-21 00:41:30 +09:00
metalefty
12ff5d4814
Merge pull request #2952 from metalefty/v0.10-just-log-image-remotefx
[v0.10] Just log Image RemoteFX codec
2024-02-21 00:38:00 +09:00
Koichiro Iwao
8a1e6f74f7 Just log Image RemoteFX codec 2024-02-21 00:16:56 +09:00
matt335672
d769b402bc 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.
2024-02-21 00:14:26 +09:00
matt335672
ab698c3d58 Clear memory allocated to resized bitmaps
This prevents valgrind errors when resizing the screen to
a larger size on GFX systems.
2024-02-21 00:14:26 +09:00
matt335672
355a71fe6d 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.
2024-02-21 00:14:26 +09:00
matt335672
ee37eb2803 EGFX: Ignore incoming messages after close sent 2024-02-21 00:14:26 +09:00
matt335672
74c2f7c4a7 Rework xrdp to support new module resize interface
This commit compiles.
2024-02-21 00:14:26 +09:00
matt335672
66a8e93f3c 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
2024-02-21 00:14:26 +09:00
matt335672
9f422cc306 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.
2024-02-21 00:14:26 +09:00
matt335672
dc6ac9758b Update neutrinordp module
Neutrinordp module now compiles with updated monitor resize
interface
2024-02-21 00:14:26 +09:00
matt335672
bfecd1887b 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.
2024-02-21 00:14:26 +09:00
matt335672
b0a30a3581 Add a client_resize_mode field
This stores what kind of resizing (if any) can be achieved with
a Deactivation-Reactivation sequence.
2024-02-21 00:14:26 +09:00
matt335672
1917b9c747 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.
2024-02-21 00:14:26 +09:00
matt335672
e00236193f 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.
2024-02-21 00:14:26 +09:00
Koichiro Iwao
6272ae6018 Bump version to v0.9.90, v0.10.0 will be out soon 2024-02-08 22:04:35 +09:00
metalefty
494376438c
Merge pull request #2941 from metalefty/format
Apply astyle 3.4 code formatter
2024-02-08 22:02:30 +09:00
Koichiro Iwao
2307608cfb Apply astyle 3.4 code formatter 2024-02-08 21:53:58 +09:00
metalefty
45fd497645
Merge pull request #2891 from neutrinolabs/gfx_mainline_merge_work
Gfx mainline merge work
2024-02-08 21:50:16 +09:00
metalefty
4f8301f38a
Merge pull request #2940 from metalefty/astyle
Update astyle to 3.4.12
2024-02-08 21:39:19 +09:00
Koichiro Iwao
b8f0094603 Simplify cloning astyle source 2024-02-08 21:17:03 +09:00
metalefty
76242bbf63
GFX: Relegate some logs to LOG_DEVEL (#2939) 2024-02-08 21:09:09 +09:00
Koichiro Iwao
47d4ab1339 Apply astyle 3.4 code formatter 2024-02-08 15:52:54 +09:00
Koichiro Iwao
ffd25af182 astyle: replace depreacted astyle options
with compatible ones with astyle 3.4. Now configuration is compatible
both astyle 3.1 and 3.4.
2024-02-08 15:34:17 +09:00
Koichiro Iwao
b39c12f351 Update astyle to 3.4.12
as astyle 3.1 is no longer available in the latest FreeBSD.

Also, astyle upstream repository has been moved to GitLab. Switched git
to obtain astyle source.

https://gitlab.com/saalen/astyle
2024-02-08 15:34:17 +09:00
Nexarian
8027a42497 More NPE fix 2024-02-02 21:19:49 -05:00
Nexarian
75b41afa04 Fix crash with resizing 2024-02-02 18:53:41 -05:00
jsorg71
33539c1d8b
Gfx mainline merge multimon1 (#2933)
* GFX: work on multimon

* fix for non GFX multimon
2024-02-01 10:28:30 -05:00
matt335672
54acca43cf Resize state machine: A fix and a question (#2929)
* Store EGFX state before entering resize state machine

At present the EGFX state is destroyed by states WMRZ_EGFX_DELETE_SURFACE
through WRMZ_EGFX_DELETE. This means that at WMRZ_EGFX_INITIALIZE we
cannot distinguish between EGFX not being ever used, and EGFX
having been torn down. Consequently, when running non-GFX, we don't
correctly recover the session.

* Allow multiple reasons for suppress_output

Replaces the single boolean for suppress_output with
a bitmask, to allow output to be suppressed for
more than one reason

* Disable output during resize

* Add states to dynamic resize

Adds states to the dynamic resize state machine so we wait for a
Deactivation-Reactivation sequence to finish before sending pointer
updates, etc.

* suppress module output during the dynamic resize

* Add support for dynamic resize to VNC backend

xrdp_mm needs to be informed when a resize has been performed so that
the resize stte machine can be updsate.
2024-01-31 19:08:29 -05:00
matt335672
d9783a9529 Don't pass drdynvc to neutrinoRDP
Since v0.9.9, xrdp has assumed that the "drdynvc" static virtual
channel is available for its exclusive use. With GFX support, it
is necessary to codify this to prevent this sequence of operations:-

- NeutrinoRDP target sends DVC Capabilities Request PDU
- target responds wih DVC Capabilities Response PDU
- xrdp processes this, starting the GFX virtual channel again

In the future, if NeutrinoRDP requires access to virtual channels,
data may somehow need to be passed through to the target while being
parsed and handled appropriately within xrdp.
2024-01-31 19:08:29 -05:00
matt335672
d23d147dc7 Don't enable GFX if client doesn't support 32 BPP
mstsc.exe indicates it supports GFX in the early capability flags, even
if it not able to support 32 BPP. This results in a session failure
if a RDPGFX_CAPS_CONFIRM_PDU is sent on the EGFX virtual channel.
2024-01-31 19:08:29 -05:00
matt335672
e5d455d0be error-check xrdp_mm_egfx_send_planar_bitmap() paths
Without some checking for this call, it's possible for the xrdp
process to never end when the client goes away.
2024-01-31 19:08:29 -05:00
Christopher Pitstick
ccead296e6 Fix service call filter. 2024-01-31 19:08:29 -05:00
Jay Sorg
3fab31c644 GFX: fix multimon login screen drawing 2024-01-31 19:08:29 -05:00
Nexarian
97b2527018 Enabling RFX_PRO key frame handling.
- Also update librfxcodec
2024-01-31 19:08:29 -05:00
Nexarian
2e1f7f1484 Adding KEY_FRAME_REQUESTED parameter. 2024-01-31 19:08:29 -05:00
Nexarian
c08cebb01d Making SHM read only from xup 2024-01-31 19:08:29 -05:00
jsorg71
c961563403 GFX: sort versions, flags to return the highest version we support in… (#2911)
* GFX: sort versions, flags to return the highest version we support in caps advertise

* GFX: simpify swtich in caps_advertise

* GFX: log skipped capability versions in caps_advertise
2024-01-31 19:08:29 -05:00
Nexarian
5293f13f39 Fix resize-on-the-fly by processing memory allocation complete. 2024-01-31 19:08:29 -05:00
Nexarian
1b6ca2245d Fix memory leak and RFX encoder notify 2024-01-31 19:08:29 -05:00