fufesou / RustDeskIddDriver

This IDD driver is based on official [Indirect Display Driver Sample](https://github.com/microsoft/Windows-driver-samples/tree/master/video/IndirectDisplay).
Microsoft Public License
72 stars 52 forks source link

There is a problem updating the monitor mode #12

Open N0exp opened 3 weeks ago

N0exp commented 3 weeks ago

When entering a, except for the first increased display resolution, the other display resolutions are not changed, and all resolutions are the default resolution at the time of creation

fufesou commented 3 weeks ago

RustDeskIddDriver will not change the settings of other monitors.

The system remembers the relative positions of different monitors.

For example, if there are two monitors, A+B, and their positions and resolutions are adjusted the first time, then when there are two monitors for the second time, for example, A first and then B, the previous settings will be restored.

fufesou commented 3 weeks ago

You can find the system settings in the register HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers\Configuration

N0exp commented 3 weeks ago

For example, adding two virtual monitors A+B, according to your code, when adding monitors, it will change the new resolution through the MonitorModesUpdate function, but in fact, only A has changed, and in any case, it can not change the resolution of B. The first parameter of IddCxMonitorUpdateModes has no actual effect. The resolution of A is changed regardless of whether IDDCX_MONITOR of A or B is passed

fufesou commented 3 weeks ago

Ok, I get it. I'll test later.

N0exp commented 3 weeks ago

Is there a way to change the default display of the first virtual screen? Can I directly change how the second screen is displayed?

fufesou commented 3 weeks ago

Please explain more details. I cannot understand clearly.

N0exp commented 3 weeks ago

For example, if I add virtual monitors A and B, and B is the virtual monitor that is added later, how can I update the display mode of only monitor B, while the display mode of A remains unchanged

fufesou commented 3 weeks ago

I don't know, but I'll test it later.

N0exp commented 3 weeks ago

Okay, can you tell me the results after you finish testing? I'm not sure if I had a problem using the IddCxMonitorUpdateModes function, but the function returned success.Thanks

fufesou commented 2 weeks ago

I've tested. MonitorModesUpdate() works as expected.

I've made a simple change in the sample code.

image

Then the added monitors resolutions are:

image

image

N0exp commented 2 weeks ago

I modified it according to you. After I tried it, it didn't work. The virtual monitor on the first connection is always updated, and the virtual monitor on the second connection is not updated. The display mode of the second virtual display is the same as when it was created. I tried it on windows1909

fufesou commented 1 week ago

Hi, my OS is Win11 22H2, build version is 22621.3737.

You can sync the main branch to test. I've added a command to update monitor modes of the specified monitor.