xrdp icon indicating copy to clipboard operation
xrdp copied to clipboard

rdesktop's black-square cursor

Open imc0 opened this issue 7 years ago • 12 comments

When viewing xorgxrdp using rdesktop, the cursor is displayed in a black square. Now this is really rdesktop's fault, but rdesktop doesn't currently support the alpha channel in a 32-bit cursor image.

xorgxrdp is currently sending an AND mask of all zeros when it sends a 32-bit cursor image. I guess this is legal (although I don't have the protocol specs), but would it be friendly to supply a useful AND mask instead of all zeros in case the client doesn't support the alpha channel?

Suggest something like:

  set_pixel_safe(cur_mask, i, 31 - j, 32, 32, 1, p&(1<<31) ? 0 : 1);

when setting the colour value for each pixel in the cursor (rdpCursor.c:267). This makes the AND mask transparent for pixels whose opacity is < 0.5.

imc0 avatar Sep 15 '17 16:09 imc0

I think there is already a setting for this in xrdp.ini. RDP calls the alpha cursors "new cursors"

jsorg71 avatar Sep 15 '17 17:09 jsorg71

OK, you are right, so this bug is therefore a cosmetic issue rather than anything important. Should the mask be sent back as all zeros when the cursor has an alpha channel?

imc0 avatar Sep 18 '17 15:09 imc0

The flag to turn off new cursors should only be used for clients with this bug. rdesktop is claiming it can do new cursors but it can not. I think both masks are still used, New Pointer Update. https://msdn.microsoft.com/en-us/library/cc240619.aspx

jsorg71 avatar Sep 18 '17 17:09 jsorg71

According to that document, the only difference between a New Pointer and a Color Pointer is that the New Pointer is able to specify the bpp of the xor mask. rdesktop does support this. The document does not specify what the masks mean when the bpp is 32 (but yes, it does say that both masks are present).

imc0 avatar Sep 18 '17 19:09 imc0

I think there is already a setting for this in xrdp.ini. (c) @jsorg71 The flag to turn off new cursors should only be used for clients with this bug. rdesktop is claiming it can do new cursors but it can not. (c) @jsorg71

Can you please point me to this flag? I'm using Ubuntu 18.04 as my remote machine with the following config:

$ sudo apt-get install xrdp
$ sudo ufw allow 3389/tcp
$ systemctl enable xrdp.service
$ systemctl start xrdp.service
$ systemctl enable xrdp-sesman.service # probably not needed on Ubuntu?
$ systemctl start xrdp-sesman.service # probably not needed on Ubuntu?
$ printf '#!/bin/bash\nawesome\n > ~/.Xsession # to launch awesome wm

At my home machine on Arch if I use:

$ rdesktop -f -u <user> <ip>

I'm, seesing black sqaure around the cursor cursor like here: https://github.com/FreeRDP/FreeRDP/issues/3863. If I get the newest freerdp from git and use

$ xfreerdp /f /u:<user> /p:<pwd> /v:<ip>

the black square around the cursor is gone. But I still want to be able to use rdesktop. I've search through man xrdp.ini and found no flag about the cursor alpha or new cursor or similar. Can you please point me to how to set up xrdp so that it works with rdesktop?

xor512 avatar Dec 31 '18 09:12 xor512

In /etc/xrdp/xrdp.ini: new_cursors=false

xrdp's black square cursor is supposed to have been fixed but there hasn't been a stable release since this commit was added (and thus I haven't tested it).

imc0 avatar Dec 31 '18 10:12 imc0

It worked, thanks you very much!

xor512 avatar Jan 02 '19 05:01 xor512

I just had to use this with ubuntu 20.04. Still works. Thanks!

kshartman avatar Jun 26 '20 03:06 kshartman

Same thing with XFCE 4.12 on Ubuntu 18.04 via iOS RDP app "Jump". new_cursors=false fixes it

perelin avatar Oct 10 '20 22:10 perelin

On Jump Desktop on macOS, what worked for me was unchecking the Mouse: Cursor updates item in the Keyboard & Mouse menu.

tobych avatar Apr 23 '21 21:04 tobych

On Jump Desktop on macOS, what worked for me was unchecking the Mouse: Cursor updates item in the Keyboard & Mouse menu.

Worked for me!

cwilby avatar Jul 07 '21 05:07 cwilby

Removing cursor updates in Jump desktop just means you don't see all the remote cursors. I'm still having trouble with cursors (regardless of settings).

rcarmo avatar Apr 15 '23 21:04 rcarmo