cedrozor / myrtille

A native HTML4 / HTML5 Remote Desktop Protocol and SSH client
https://www.myrtille.io
Apache License 2.0
1.81k stars 375 forks source link

Cursor doesn't change to an I-bar #161

Open joburg opened 5 years ago

joburg commented 5 years ago

When moving the cursor within a document editor like Word or hovering it over the command line area of the browser, standard RDP (not connecting thru the gateway), the cursor will shift from an arrow to an I-bar.

But when connected thru the gateway, cursor doesn't change. In fact, at times the cursor changes to a spinning blue circle (which sometimes it gets stuck in that cursor image and will only change if you move the mouse around).

Added screenshots to illustrate UsingGateway NotUsingGateway

.

Is this by design or a setting I need to change?

cedrozor commented 5 years ago

I see that you are using Chrome, does the problem occurs with others browsers (Firefox, Edge, etc.)? Do you use HTML5 (websockets) or HTML4 (long-polling). You can check that by clicking the "stat" button into the toolbar.

joburg commented 5 years ago

Yes, it happens for all browsers. I've tested using Firefox, Opera, Edge, Chrome and Safari. Using HTML5.

cedrozor commented 5 years ago

Thanks. On which operating system does the RDP server run?

joburg commented 5 years ago

It is running on Windows Server 2016. I thought it might have been the FreeRDP client but I used the FreeRDP client that was in the folder with the Myrtille service and I saw that the cursor behavior was what it was supposed to be. That is, it changed into an I-beam when the mouse hovers over the browser command line. Where it actually matters is in the 2 following areas:

cedrozor commented 5 years ago

Thanks for the report, I will investigate.

joburg commented 5 years ago

Coming back to this issue... It's not just the I-bar that's an issue, we are seeing the cursor get "stuck" at an image. For example, you are moving mouse around and you see the cursor changing a spinning circle (which is normal due to background tasks) but every now and then when it switches, it doesn't switch back from a spinning circle to an arrow. That is, until you hover over something else like edge of a window (that forces the cursor to change). Is there any setting that changes the sensitivity of the mouse movement so it detects the cursor image changes better?

I would like to point out, that using the FreeRDP client directly, you don't see the issue. Only through the gateway.

cedrozor commented 5 years ago

Sorry, didn't had much time to investigate, but I still have this issue on my radar. Using the myrtille toolbar, can you try to fallback to HTML4 (long-polling) mode, just to see if the problem is related to the websocket traffic? thanks.

cedrozor commented 5 years ago

Is there any setting that changes the sensitivity of the mouse movement so it detects the cursor image changes better?

There is a mouse move sampling but it's disabled by default (so that's not your issue); it can be tweaked here: https://github.com/cedrozor/myrtille/blob/master/Myrtille.Web/js/config.js#L157

joburg commented 5 years ago

Thanks. I'll play with the settings. I'll also start digging into the mouse and keyboard routines and see if there's anything there.

joburg commented 5 years ago

I narrowed down the issue to the situation/scenario where the mouse moves off a point and needs to switch to a different cursor image. For some reason, the cursor can't switch to the new image and instead remains using the previous image until you hover over another "object" that would cause the cursor to switch. So, am thinking it's the encoding of the cursor/image on the rdp client? Another reproduce-able scenario is to select text, then move the cursor away from the selected text... then do a Ctrl-C key. The cursor will switch to a "spinning blue circle" and remain that way until you hover the mouse over something else that will make it switch.

cedrozor commented 5 years ago

Yes, I also noticed this problem. I think this is due to a fast changing mouse cursor into FreeRDP and a re-entry in some function which is not allowed because of some lock. The result is the mouse cursor being stuck to a previous state.

I also found that's occuring in some applications and not with others (had the Ctrl+C spinning blue circle with notepad but not with wordpad, for example).

I will have a look at it but, as it's not a blocking issue, in lower priority.

joburg commented 5 years ago

I am assuming that the issue is occurring in the freeRDP client, right? since I can see the cursor changes when connecting directly (via TCP) using the client, would it be safe to assume that it's just an issue processing events in the namedpipes connection? And not the bug that I read, where people were seeing that the cursor disappears every now and then after applying the last major update to Windows 10.

cedrozor commented 5 years ago

Yes I think it's occuring into FreeRDP, I may have a re-entry issue with the code converting the cursor into a png before sending it through the named pipe. I don't think it's an issue with the pipe itself, because it's just a queue read by the gateway. What is the bug you are talking about with win 10?

joburg commented 5 years ago

This one... https://camerondwyer.com/2018/05/09/how-to-fix-mouse-cursor-disappearing-on-on-remote-desktop/

The native Microsoft RDP client (mstsc.exe) seems to be unaffected.

joburg commented 5 years ago

Should be ok to close. I was able to find and remedy the issue in the freeRDP client.

cedrozor commented 5 years ago

Nice :) what was the issue please? was it on the FreeRDP side or myrtille (or the myrtille code into FreeRDP)? a PR would be appreciated.

joburg commented 5 years ago

Issue was on the FreeRDP side.

cedrozor commented 5 years ago

Could you share some details please, so I can fix the issue into the next version?

cedrozor commented 5 years ago

@joburg please, it's not fair to let me search :*(

joburg commented 5 years ago

It was in your myrtille client in FreeRDP. You were flipping the pixels on the cursor image. But for some reason you don't transmit every time. I forced the cursor image to be transmitted every time. Works on Windows but produces some odd behavior in Linux.

cedrozor commented 5 years ago

Ok, I think I got it :) I was sending the mouse cursor only if it contains black bit(s); but some cursors, like the spinning blue circle, doesn't contain any and thus wasn't sent :/ like you probably did, I changed it to send it every time... but indeed, the cursor is sometimes scrambled on Linux without that check.

cedrozor commented 5 years ago

I fixed it; tested ok on Windows and some Linux distros (Fedora, Kali, Ubuntu). I will release it shortly.

cedrozor commented 4 years ago

Done :)

cedrozor commented 4 years ago

Re-opened because mouse cursor scrambling is still occuring sometimes under Linux. It may be due to animated cursor or cursor shadow, not fully supported by FreeRDP.

I tried to disable the mouse acceleration (setting acceleration profile: Flat), cursor animation and cursor shadow, following these blogs on Ubuntu:

But without success unfortunately :/

A temporary workaround, waiting for a fix into a next version, is to disable the mouse cursor updates alltogether. It's a little extreme but the only fix for the moment. Comment this line:

Replace this.setMouseCursor(idx, config.getImageMode() != config.getImageModeEnum().BINARY ? data : bytesToBase64(data), posX, posY); By //this.setMouseCursor(idx, config.getImageMode() != config.getImageModeEnum().BINARY ? data : bytesToBase64(data), posX, posY);

Please note this only occurs under Linux targets. No problem detected under Windows.

spacemania commented 4 years ago

I have a similar problem with the cursor on a Windows client. The cursor change to an I-bar, but he looks like this:

i-bar

Any idea how to fix this? In earlier versions, the problem did not exist.

cedrozor commented 4 years ago

I will check it on the next FreeRDP code resync

therealbraderz commented 4 years ago

I have a similar problem with the cursor on a Windows client. The cursor change to an I-bar, but he looks like this:

i-bar

Any idea how to fix this? In earlier versions, the problem did not exist.

Yeah, mine does exactly the same as this.