RustDeskIddDriver icon indicating copy to clipboard operation
RustDeskIddDriver copied to clipboard

There is a problem updating the monitor mode

Open N0exp opened this issue 1 year ago • 15 comments

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

N0exp avatar Jun 13 '24 18:06 N0exp

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 avatar Jun 14 '24 01:06 fufesou

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

fufesou avatar Jun 14 '24 01:06 fufesou

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

N0exp avatar Jun 14 '24 01:06 N0exp

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

fufesou avatar Jun 14 '24 01:06 fufesou

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

N0exp avatar Jun 16 '24 01:06 N0exp

Please explain more details. I cannot understand clearly.

fufesou avatar Jun 16 '24 02:06 fufesou

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

N0exp avatar Jun 16 '24 03:06 N0exp

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

fufesou avatar Jun 16 '24 03:06 fufesou

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

N0exp avatar Jun 16 '24 03:06 N0exp

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

fufesou avatar Jun 22 '24 07:06 fufesou

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

N0exp avatar Jun 22 '24 08:06 N0exp

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.

fufesou avatar Jun 30 '24 01:06 fufesou

I tried on the win11 system, can indeed achieve the modification, may be in the new system Microsoft made processing, I want to change the display on the win10 system, how should I modify it?

N0exp avatar Aug 05 '24 03:08 N0exp

Hi, I've just tested Win10.

MonitorModesUpdate() does work, but it is a different result. It just switch current monitor modes to one of the input modes. If the mode does not exists, it will try create a temporary one.

For example, my monitor currently has 3 resolutions: 1920x1080, 1600x900, 1024x768.

When I enter m -> 1600,900,60 -> e, the monitor resolution is still these three, but the current resolution is switched to 1600x900.

When I enter m -> 1600,800,60 -> e, the monitor resolution increases by 1600x800, and the current resolution is switched to 1600x800.

When I input multiple modes it seems to choose one at random.

Maybe it relies on the Win API.

I want to change the display on the win10 system, how should I modify it?

Sorry, I have no idea.

fufesou avatar Aug 05 '24 14:08 fufesou

I had the same question。

lidahua avatar Oct 14 '24 08:10 lidahua