Skip to content

RDP: Handle transparent mouse pointer bitmaps better

Quoting the most relevant commit here:

Currently, when a mouse pointer changes in a session, g-r-d sends an
update of the new mouse pointer bitmap or use an already cached one
when the client already has the pointer bitmap.
This also applies to hidden mouse pointers, which are usually submitted
when for example a video is being played in the remote session and the
mouse pointer lies in the video area.
In such cases it is just wasteful to submit a full pointer bitmap which
is actually completely empty.
With Firefox, for example, such pointer bitmap can have a size of
64 * 64 * 4 Bytes.
Moreover, it also creates a problem with mstsc, since mstsc can't
handle such complete transparent pointer bitmaps.
Instead of hiding the mouse pointer, mstsc turns the mouse pointer
bitmap into a black square.

To solve this issue, use the PointerSystem update to tell the client to
hide the mouse pointer on the client side, instead of submitting a new
pointer bitmap.
This also has the advantage that the size of the transparent pointer
bitmap doesn't matter, since such pointer bitmaps are filtered out
first before submitting a pointer update and therefore also not
pollute the pointer cache with empty data.

To identify a hidden mouse pointer, check the alpha bits of the
mouse pointer bitmap.
In a bitmap of a hidden mouse pointer, all alpha bits are set to 0.

Tested with both mstsc and xfreerdp.

Edited by Pascal Nowack

Merge request reports