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

cursor repeat #81

Closed
hhmfs opened this issue Feb 5, 2024 · 19 comments
Closed

cursor repeat #81

hhmfs opened this issue Feb 5, 2024 · 19 comments
Labels
bug Something isn't working

Comments

@hhmfs
Copy link

hhmfs commented Feb 5, 2024

When I create and open a virtual screen and use remote software streaming connection, two cursors appear on my screen, one on the controlled side and one on the master side, and there is a slight ghost as I move. How to solve this problem? Thank you very much!

@hhmfs hhmfs added the bug Something isn't working label Feb 5, 2024
@MolotovCherry
Copy link
Owner

MolotovCherry commented Feb 5, 2024

This has been a reported problem on the c++ driver implementations as well (also the example driver project). Unfortunately, it's currently unknown how to solve it.

If anyone knows the cause, feel free to add them here.

OP: Can you add reproducible steps?

@nomi-san
Copy link
Contributor

nomi-san commented Feb 22, 2024

You will get double cursor on Parsec or similar remote desktop apps when the hardware cursor is not supported in your virtual display. One cursor on local screen and another one on remote client.

image

To solve it, just call IddCxMonitorSetupHardwareCursor in your assign_swap_chain().

self.swap_chain_processor = Some(processor);

Here's the C++ example:

void IndirectMonitorContext::AssignSwapChain(IDDCX_SWAPCHAIN SwapChain, LUID RenderAdapter, HANDLE NewFrameEvent)
{
  // after successfully assigning swapchain processor

  // create an event to get notified new cursor data
  HANDLE mouseEvent = CreateEventA(
    nullptr, //TODO set proper SECURITY_ATTRIBUTES
    false, 
    false,
    "arbitraryMouseEventName");;

  // set up cursor capabilities
  IDDCX_CURSOR_CAPS cursorInfo = {};
  cursorInfo.Size = sizeof(cursorInfo);
  cursorInfo.AlphaCursorSupport = true;
  cursorInfo.MaxX = 64; //TODO figure out correct maximum value
  cursorInfo.MaxY = 64; //TODO figure out correct maximum value
  cursorInfo.ColorXorCursorSupport = IDDCX_XOR_CURSOR_SUPPORT_NONE; //TODO play around with XOR cursors

  // prepare IddCxMonitorSetupHardwareCursor arguments
  IDARG_IN_SETUP_HWCURSOR hwCursor = {};
  hwCursor.CursorInfo = cursorInfo;
  hwCursor.hNewCursorDataAvailable = mouseEvent; // this event will be called when new cursor data is available

  NTSTATUS Status = IddCxMonitorSetupHardwareCursor(
    m_Monitor, // handle to the monitor we want to enable hardware mouse on
    &hwCursor
  );
  
  // handle [Status] error
}

@MolotovCherry
Copy link
Owner

@nomi-san Thank you very much! I'll try to reproduce this later (along with the fix)!

MolotovCherry added a commit that referenced this issue Mar 27, 2024
@MolotovCherry
Copy link
Owner

MolotovCherry commented Mar 27, 2024

Anybody reading this, would you mind testing out this hardware cursor implementation?
I tested locally and think it's working, but I need more eyes on this before I can mark it as solved.

(note: this release only has a cli. make sure you completely uninstall and remove old driver before installation)

(there's a download link for the files under "artifacts")
https://github.com/MolotovCherry/virtual-display-rs/actions/runs/8457389727

@nomi-san
Copy link
Contributor

I've tested and it works properly.
You should provide user script to install the driver with ease.

start /wait .\nefconw.exe --remove-device-node --hardware-id Root\VirtualDisplayDriver --class-guid "4D36E968-E325-11CE-BFC1-08002BE10318"
start /wait .\nefconw.exe --create-device-node --class-name Display --class-guid "4D36E968-E325-11CE-BFC1-08002BE10318" --hardware-id Root\VirtualDisplayDriver
start /wait .\nefconw.exe --install-driver --inf-path ".\VirtualDisplayDriver.inf"

I've opened a PR to add it to the README #107.
You also should change the portable release by adding the nefconw CLI, and remove the manual installation (via device manager) in README.

@MolotovCherry
Copy link
Owner

I've tested and it works properly.

Perfect! Thanks for testing it

nomi-san added a commit to nomi-san/parsec-vdd that referenced this issue Mar 29, 2024
- add vdd 0.45 download
- add nefconw, remove devcon
- ref: MolotovCherry/virtual-display-rs#81
@yaole-A
Copy link

yaole-A commented Aug 30, 2024

I used the latest driver. After the driver was successfully installed, I successfully added the monitor using cli, but it still had repeat cursor
image
image
f73b314f3ae526526d5d70857e2d0442

@MolotovCherry
Copy link
Owner

I used the latest driver. After the driver was successfully installed, I successfully added the monitor using cli, but it still had repeat cursor ?

Does the program support capturing the mouse / is your mouse captured?

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

Not only this program, parsec also does this

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

There is no problem with parsec vdd. This project will still capture it. I used two remote software (deeplink and parsec)tests and repeat cursor occurred in both software.
b2d8e65e53fa299513bd304854535017

@MolotovCherry
Copy link
Owner

Not only this program, parsec also does this

What's the driver's version?

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

this
image

@MolotovCherry
Copy link
Owner

MolotovCherry commented Aug 30, 2024

this

Can you open device manager, double click on the driver, and show the version listed?

image

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

image

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

I tried it on another machine and it worked.I don’t know why this machine still has two cursor.so strange

@MolotovCherry
Copy link
Owner

Thank you. At this moment I don't know what the problem could be as I can't reproduce it on my end.

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

It's strange, the steps are the same, but one works successfully and the other fails.maybe I can reinstall the system on the failed machine and try again.

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

I found that if I use the IddSampleDriver virtual monitor, there are two cursors, whether on the desktop or in the game. If I use your virtual monitor, there will be two situations. One is that there will be two cursors on the desktop and the browser (cursor is Native), but there is only one cursor when entering the game (the cursor changes after entering the game)

@yaole-A
Copy link

yaole-A commented Aug 30, 2024

1724987508293
IMG_20240830_111140

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants