Powertoys: [FancyZones] Cannot use separate layouts on multi-monitor

Created on 31 Oct 2019  路  52Comments  路  Source: microsoft/PowerToys

Environment

Windows build number: [Version 10.0.18362.387]
PowerToys version: 0.12.0.0
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

I have 2 custom layouts. One for the left monitor, one for the right.

  1. I move the mouse to the left monitor and press [WIN] ~
  2. I choose Custom, and the left layout option.
    left
  1. I click Apply
  2. I move the mouse to the right monitor and press [WIN] ~
  3. I choose Custom, and the right layout option.
    right

I click Apply.
The right monitor layout is applied to all monitors. I have tried also just moving the settings window before hitting apply but that doesn't work either.

I can also use the main settings window, drag to the monitor, change the layout, and the same behavior happens, both monitors are updated.

Expected behavior

Expected to be able to have a separate layout on different monitors.

Actual behavior

Identical layout applied to all monitors.

Screenshots

Cost-Large Issue-Bug Product-FancyZones Tracking-External

Most helpful comment

@Gadgetgeek2000
awesome! It's confirmed 100%.
We are making other fixes to the FZ editor and also moving the settings from the registry to a human readable json file.
I don't have an ETA for this fix since it might have to wait until we complete the registry migration.
I'll keep you posted as soon as I have news.

Thanks again for the great help finding the bug.

All 52 comments

Have you tried a re-install?

I tried re-creating this issue but was not able to on my end.

I just installed for the first time yesterday when I reported the issue. I'm going to reboot to see if there is any change in behavior. I have a black window on my monitor right now that I can resize, but cannot move, close or minimize. I have no idea what it is. The window showed up after changing some of the settings for FancyZones.
2019-10-31 07_41_27-Window

Reboot did nothing. I am not able to apply a separate layout (or figure out how to apply a separate layout). I believe I am doing it correctly but both monitor zone layouts stay in sync.

@Gadgetgeek2000, when you start the zone editor, does it appear on the screen which zones you want to set?

@Gadgetgeek2000, when you start the zone editor, does it appear on the screen which zones you want to set?

Yes. I move the mouse to the monitor I want to set, and click [WIN]+[], the layout editor shows on that monitor. Setting the zone layout for that monitor also changes my other monitor. I can go back to the other monitor press [WIN]+[] and set that one, and it also sets all screens to the same zone layout.

@Gadgetgeek2000
can you please describe your monitors configuration?

  • native resolution and scaling factor for monitor on the left
  • native resolution and scaling factor for monitor on the right

These are the steps to export the registry settings used by FancyZones to save the zones configuration:

  • open the Start menu, type regedit and the Registry Editor app should appear as best match, click on it.
  • in the regedit app, open the folder tree to find the Computer\HKEY_CURRENT_USER\Software\SuperFancyZones key (as an alternative you can search for it using Ctrl + F and typing SuperFancyZones)
  • on the SuperFancyZones key, right-click and select Export, as shown in the picture below, choose the desktop folder as saving location and type a name for the file.

image

  • go to the desktop and zip the .reg file
  • here, add a comment and simply drag and drop the .zip file

Thanks.

I have 3 monitors, but the third is not always connected. If it is connected, it is mirroring my left screen (when people come to my desk so they can see). All monitors are identical: Samsung 4K displays. All at native resolution, 3840x2160, and 100% scaling (no scaling).

Attached is a zip file of 2 exports. One where I had the config on the left monitor correct. One where I had the config on the right monitor correct.
fancyzonereg.zip

Insanity ... doing the same thing over and over and expecting a different result. Video recording of the monitors trying to set zones.
fancyzones.zip

@Gadgetgeek2000
thanks for sending the file.
I think I've found the source of the bug. It needs more investigation but it seems the FancyZones editor gets confused and uses the same ID for both monitors, so it causes what you described: it overwrites what you previously saved on the other monitor.

After saving the layout for the left monitor:

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{00000000-0000-0000-0000-000000000000}]
"ActiveZoneSetId"="{0BD15C55-7AE3-46D8-B0CA-80D259038103}"

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{481B43B8-40CD-44DA-8C15-666BB0033F15}]
"ActiveZoneSetId"="{50DABBD2-AFEC-4680-96AE-B1157D735056}"

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{97A0B0D2-F015-4431-9C93-A6B6045FADF9}]
"ActiveZoneSetId"="{0BD15C55-7AE3-46D8-B0CA-80D259038103}"
"ZoneCount"=dword:00000004

After saving the layout for the right monitor:

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{00000000-0000-0000-0000-000000000000}]
"ActiveZoneSetId"="{3CA74C27-4AF6-4E9C-89E3-A9E1DD76A9B7}"

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{481B43B8-40CD-44DA-8C15-666BB0033F15}]
"ActiveZoneSetId"="{50DABBD2-AFEC-4680-96AE-B1157D735056}"

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{97A0B0D2-F015-4431-9C93-A6B6045FADF9}]
"ActiveZoneSetId"="{0BD15C55-7AE3-46D8-B0CA-80D259038103}"
"ZoneCount"=dword:00000004

I knew I wasn't crazy! :) Thanks for looking into this.

@Gadgetgeek2000
to be sure I got it right, can you do one more test? Basically redo what you have done before but with a clean registry deleting the SuperFancyZones key first, so we can be sure the bug is as described in my previous comment.
Unfortunately I have all different monitors and the FZ editor uses different IDs for each, so I can't reproduce the bug myself.

The steps are:

  • exit PowerToys
  • open regedit, right click on the SuperFancyZones and select Delete and click Yes on the confirmation dialog.
  • restart PowerToys
  • create and save a layout for the first monitor
  • reopen regedit (if it was still open press F5 to refresh the view), go to the SuperFancyZones key and export the key
  • go back to the FZ editor, create and save a different layout for the second monitor
  • reopen regedit (if it was still open press F5 to refresh the view), go to the SuperFancyZones key and export the key

Thanks.

The same thing happens when I have two identical Dell 27" connected: They get the same layout regardsless the order or position I define.

When I use the internal laptop screen with one external 27" they can be set separately.

Hi @fvanroie
thanks for the feedback, your configuration confirms it's a bug when the monitors are identical and the editor fails to create different IDs.

Confirmation. Deleted the registry key, restarted, created layout for left, created layout for right, set layout for left, set layout for right.
clean, create, set.zip

Thanks for all your help.

@Gadgetgeek2000
awesome! It's confirmed 100%.
We are making other fixes to the FZ editor and also moving the settings from the registry to a human readable json file.
I don't have an ETA for this fix since it might have to wait until we complete the registry migration.
I'll keep you posted as soon as I have news.

Thanks again for the great help finding the bug.

Sounds great. I only wanted it because the software said it was possible. :) I can definitely work around it in the meantime. On my 4K displays it is nice to be able to split up areas of the screen that would hold an HD 1920x1080 application. I'll watch for resolution.

@Gadgetgeek2000
so it turned out that in your case the WIndows API we called to get the list of connected displays is failing and therefore FancyZones thinks you have just one monitor connected.
Can you tell us more about the hardware configuration of the PCs:

  • CPU
  • do you have a dedicated GPU?
  • how do you connect your monitors:

    • cable type and to which ports

    • are the monitors connected in daisy-chain?

  • exact model of the Sumsung monitors
  • any other thing that might be interesting for this issue

Thank you.

I have an HP desktop. Intel Core I7-6700K with an NVIDIA GEForce GTX 970 GPU. There are 4 outputs for monitors on the back of this card. Driver is up-to-date 11/5/2019, version 26.21.14.4120. Monitors are not daisy-chained. Each is connected to the video card.

2 of the ports are HDMI, 2 are DisplayPort. I have 3 monitors plugged in, but currently have one monitor disabled (that one is used for visitors, where I mirror monitors 2 and 3.

Monitor 3 is set as my primary display. Monitor 1 to the right of that.
monitor layout

I use TeamViewer to remote control my computer. In order to blank out the screen I recently installed the TeamViewer Monitor driver. This was installed in the last few weeks or so. (10/24/2019 in the event timestamp). This driver can be uninstalled for testing if you like.
teamviewer monitor driver

The monitors are all identical. Samsung LU28E590DS/ZZ. Monitor 3 is connected via HDMI. Monitors 1 and 2 connected by DisplayPort.

DXDiag output:
DxDiag.txt

Let me know if there is something else you want me to check.

Thanks for the detailed info.
The TeamViewer Monitor driver may play a role, so if you can give it a try and uninstall it, it would be helpful.
After un-installing it, open again the Device Manage and check how the monitors are labeled, in theory it should shown the brand and model name.
Thanks.

Same layout behavior after uninstalling the TeamViewer driver. Monitors now show Generic PnP Monitor.
monitors after teamviewer driver uninstall

I went to the Samsung website and downloaded the drivers. It was kind of a pain because the install program only let me install drivers for one of the monitors. I had to find where it dropped the driver files on my computer, manually updating the drivers in Device Manager, with the manual, manual, have disk option.

monitors after drivers

Exit, restart PowerToys. Same behavior. Exported registry so you can see the change.
superfancyzones after driver updates, no clean registry.zip

The registry now shows this:

[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_1920_1080_{00000000-0000-0000-0000-000000000000}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_2560_1440_{00000000-0000-0000-0000-000000000000}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_2560_1600_{00000000-0000-0000-0000-000000000000}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{00000000-0000-0000-0000-000000000000}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{481B43B8-40CD-44DA-8C15-666BB0033F15}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\LOCALDISPLAY_3840_2160_{97A0B0D2-F015-4431-9C93-A6B6045FADF9}]
[HKEY_CURRENT_USER\Software\SuperFancyZones\SAM0C4D#5&2f5ebf57&0&UID4358_3840_2160_{00000000-0000-0000-0000-000000000000}]

Before it was only showing LOCALDISPLAY_3840_2160 that should not happen, and now it shows SAM0C4D#5&2f5ebf57&0&UID4358_3840_2160 that is what it's expected, of course it should show not just one but one per monitor.

One last thing to verify before we send you a test app.
Can you delete the SuperFancyZones reg key so we verify if it only creates one entry for SAM0C4D#5&2f5ebf57&0&UID4358_3840_2160?

Same behavior. only 1 monitor listed in registry.

after registry clean and setup zones again.zip

Thanks for looking into this.

@Gadgetgeek2000 Thank you for the provided info! There's indeed only a single monitor present. I believe we're very close to pinpointing the issue cause. Could you please run this command:

Get-WmiObject -Query "select * from wmiMonitorID" -namespace "root\wmi"

in the powershell prompt and provide its output? In the meantime I'll prepare a custom diagnostic tool which should give us a full picture - would you prefer to receive it as an executable file or a single .cpp source that you could compile locally(Visual Studio is required)?

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:WINDOWSsystem32> Get-WmiObject -Query "select * from wmiMonitorID" -namespace "rootwmi"

__GENUS : 2
__CLASS : WmiMonitorID
__SUPERCLASS : MSMonitorClass
__DYNASTY : MSMonitorClass
__RELPATH : WmiMonitorID.InstanceName="DISPLAY\SAM0C4D\5&2f5ebf57&0&UID4358_0"
__PROPERTY_COUNT : 9
__DERIVATION : {MSMonitorClass}
__SERVER : GEOFFF
__NAMESPACE : rootwmi
__PATH : \GEOFFFrootmd5-800223e916b29091e84d6a20749e848bwmi:WmiMonitorID.InstanceName="DISPLAY\SAM0C4D\5&2f5ebf57&0&UID4358_0"
Active : True
InstanceName : DISPLAYSAM0C4D5&2f5ebf57&0&UID4358_0
ManufacturerName : {83, 65, 77, 0...}
ProductCodeID : {48, 67, 52, 68...}
SerialNumberID : {72, 84, 80, 72...}
UserFriendlyName : {85, 50, 56, 69...}
UserFriendlyNameLength : 13
WeekOfManufacture : 37
YearOfManufacture : 2016
PSComputerName : GEOFFF

__GENUS : 2
__CLASS : WmiMonitorID
__SUPERCLASS : MSMonitorClass
__DYNASTY : MSMonitorClass
__RELPATH : WmiMonitorID.InstanceName="DISPLAY\SAM0C4D\5&2f5ebf57&0&UID4354_0"
__PROPERTY_COUNT : 9
__DERIVATION : {MSMonitorClass}
__SERVER : GEOFFF
__NAMESPACE : rootwmi
__PATH : \GEOFFFrootmd5-800223e916b29091e84d6a20749e848bwmi:WmiMonitorID.InstanceName="DISPLAY\SAM0C4D\5&2f5ebf57&0&UID4354_0"
Active : True
InstanceName : DISPLAYSAM0C4D5&2f5ebf57&0&UID4354_0
ManufacturerName : {83, 65, 77, 0...}
ProductCodeID : {48, 67, 52, 68...}
SerialNumberID : {72, 84, 80, 72...}
UserFriendlyName : {85, 50, 56, 69...}
UserFriendlyNameLength : 13
WeekOfManufacture : 36
YearOfManufacture : 2016
PSComputerName : GEOFFF

__GENUS : 2
__CLASS : WmiMonitorID
__SUPERCLASS : MSMonitorClass
__DYNASTY : MSMonitorClass
__RELPATH : WmiMonitorID.InstanceName="DISPLAY\SAM0C4C\5&2f5ebf57&0&UID4353_0"
__PROPERTY_COUNT : 9
__DERIVATION : {MSMonitorClass}
__SERVER : GEOFFF
__NAMESPACE : rootwmi
__PATH : \GEOFFFrootmd5-800223e916b29091e84d6a20749e848bwmi:WmiMonitorID.InstanceName="DISPLAY\SAM0C4C\5&2f5ebf57&0&UID4353_0"
Active : True
InstanceName : DISPLAYSAM0C4C5&2f5ebf57&0&UID4353_0
ManufacturerName : {83, 65, 77, 0...}
ProductCodeID : {48, 67, 52, 67...}
SerialNumberID : {72, 84, 80, 72...}
UserFriendlyName : {85, 50, 56, 69...}
UserFriendlyNameLength : 13
WeekOfManufacture : 29
YearOfManufacture : 2016
PSComputerName : GEOFFF

PS C:WINDOWSsystem32>

EXE is good.

@Gadgetgeek2000 Thanks. Alright, please download the diagnostic tool and launch it on the PC. It should generate a monitor-info-report-<TIME>.txt which contains the execution result of current fancyzones logic which is responsible for selecting registry key names. I'll be able to track it from there.

@Gadgetgeek2000 Thank you for this output. As you may noticed EnumDisplayDevices produces weird results on your machine: DeviceID, DeviceKey and DeviceString are identical, even though the DeviceNameS are different(DISPLAY1/DISPLAY2). We'll need some time to investigate this behavior and update you when we have a solution.

Yes. I wonder if it is some sort of artifact of having multiple display outputs from the same video card, or if it is because I have multiple of the exact same monitor.

As a test, I swapped out one of the 4K monitors with another HD monitor. Fancyzones can maintain separate layouts on each.

change monitor.zip

Monitor info report
monitor-info-report-14-11-2019-11-07-16.txt

I put my monitors back the way they were after exporting the data for you. Now I get separate layouts on monitors. I can no longer seem able to replicate the bug.
monitors back like usual.zip

monitor-info-report-14-11-2019-11-17-11.txt

Now the test app shows different DeviceID values for the two monitors and so FancyZones can handle them correctly.
Seems like a Windows API/device driver bug that only happens under some obscure circumstance, it may not even be caused by having two identical monitors, it may just a random conflict during Windows startup or when connecting/disconnecting a monitor.

I labeled this as external since it's not a bug in the PowerToys code.

We can still make our code more robust since this bug may be more common than we think.
Using DeviceID + DeviceName instead of just DeviceID to identify each monitor.

I wasn't going to chime in on that, but I guess I'll say:

  • PowerToys didn't work as expected
  • Your monitor detection inside the application only showed 1 monitor
  • Your diagnostic tool is able to discern multiple monitors
  • Relying on the OS to be unique with DeviceID may not be prudent, especially if you have seen examples where it didn't work properly

Probably a good idea to build extra into the code just in case it happens with someone else. Thanks for helping! I'll let you know if it happens again. I just rebooted to check and things still look fine.

Using the Monitor Info Report tool, I also see that my DeviceIDs are the same with only a different DeviceName. So the DeviceID in itself is _not_ always unique. Please take the DeviceName into account as it will certainly make PowerToys more robust in this situation.

monitor-info-report-14-11-2019-22-48-57.txt

Hi @fvanroie
thanks for sending the report, that confirms is not an isolated case.
Sure, we will make the logic more robust to workaround the API bug.
Thank you!

@Gadgetgeek2000
I've a question that is not related to the bug.
You said you remote connect to your PC.
When you do so, would you prefer FZ to treat it as a different monitor, so that you can use a dedicated zones configuration for it, or would you prefer to have FZ using the same zones configuration that you set on your main physical monitor?
When remoting, are you using the same screen size of the physical monitor of the remote PC?
Thanks.

@Gadgetgeek2000
I've a question that is not related to the bug.
You said you remote connect to your PC.
When you do so, would you prefer FZ to treat it as a different monitor, so that you can use a dedicated zones configuration for it, or would you prefer to have FZ using the same zones configuration that you set on your main physical monitor?
When remoting, are you using the same screen size of the physical monitor of the remote PC?
Thanks.

These are interesting questions...and the answer is "it depends". Rarely do I enjoy a 4K monitor remotely, and if I do, I certainly don't have multiple. I also connect to my computer differently depending on my use case.

Here are some of the situations that I use remote:

  1. On-site, I grab my laptop and go to a conference room. I use Microsoft Remote Desktop to connect to the desktop. This brings my multiple monitors down to 1, moves all the windows onto the one. I do not connect to RDP at 4k, usually setting a manual screen size like we saw in my registry files above. I may not want FancyZones to split my smaller screen given the fewer pixel count. I like 4K because it cleanly divides into 4 HD screens, 1920x1080.

  2. Remotely, I might connect via TeamViewer. All monitors are still present at 4K resolution. This might be super tiny on my laptop screen, or just fine on my 50" 4K TV I have at home. Depends where I control from. If I'm working from home for extended period I will manually turn off one of the monitors, and set my preferred resolution for what is comfortable.

I don't believe that I would expect the software to behave differently just because I connected to it remotely, But I may want it to layout differently if I have a different resolution. 4K I like splitting up in one way. Smaller resolution I might want a different layout, or to turn it off.

Since this is a "power" toy, I think the power user should be aware how to quickly change the layout. The Win+tick keystroke is perfect for me to fix the layout quickly based on my task.

One thing I should mention is that I also routinely use the Windows Virtual Desktop feature. It looks like FZ allows different layouts on these virtual desktops. After activating a virtual desktop and trying to configure FZ, I see a standard 3-window layout. I changed one of these virtual desktops to be a left-right layout and when I go back to my main virtual desktop I still have my custom layout. Super cool. I wonder if this had anything to do with my troubles, too. I use the virtual desktop feature to focus on tasks, and I currently have 3 virtual desktops created. Check out my registry settings after activating a FZ layout on a virtual desktop.
fz after virtual desktop.zip

Using the Monitor Info Report tool, I also see that my DeviceIDs are the same with only a different DeviceName. So the DeviceID in itself is _not_ always unique. Please take the DeviceName into account as it will certainly make PowerToys more robust in this situation.

monitor-info-report-14-11-2019-22-48-57.txt

@fvanroie Do you use the Microsoft Virtual Desktop feature? Click the Task View button next to the start menu flag, and at the top of the task view click into a new desktop? Is that something we have in common?

Hi @Gadgetgeek2000. I'm not using the Virtual Desktop feature in Windows 10.
I have 2 identical screens that are connected to my laptop via a docking station. The internal screen is not used when the laptop is docked.

I have 3 identical monitors and can only set zones on the primary display

@fvanroie
in order to file the bug to the Windows team, it would help to know in details your hardware and software configuration.

  • version of Windows 10
  • GPU (dedicated or integrated) brand and model, if integrated what CPU/APU model?
  • docking station model

Thank you

@enricogior Here is my setup:

  • Dell Latitude E5530 laptop using the integrated Intel HD Graphics 4000 adapter [CPU i5-3340M]
  • Dell E-Port Plus PR02X docking station
  • 2x Dell U2713 displays connected via 2 separate Display port cables to the docking station
  • Internal display is not used

Running Microsoft Windows 10 [Version 1903 Build 18362.418]. Device drivers are up-to-date according to device manager online search.

MSDN states that:

DeviceID

Not used.

https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-display_devicea

We need to not use it at all.

I do have the same issue, using a OneLink+ docking station on a Lenovo running Windows 10 1903.
I run 3 monitors, two of the same models, all at same resolution.

is this work we'll wrap up for 0.16?

I'm getting very sporadic results with the changes in the latest version. Sometimes it works and sometimes it doesn't. I reboot and my screen layouts are all set back to default as if I have never applied a layout. Choosing a separate layout may work but then reset later. I'm not sure if it was due to the upgrade to the latest version or not. Is anyone else experiencing the same? I'm on Version v0.15.2. Thanks.

I should say that at one point recently I upgraded my graphic card drivers with the nVidia utility. It is possible that the monitors are now "new", or misconfigured because of that change.

Oh my. Looking at the registry I have many monitors (although I only have 3 monitors connected, same monitors this whole time. Sometimes I switch to 1920x1080 when I'm presenting make things readable.
2020-03-13 16_20_16-Registry Editor

Using the Monitor Info Report tool, I also see that my DeviceIDs are the same with only a different DeviceName. So the DeviceID in itself is _not_ always unique. Please take the DeviceName into account as it will certainly make PowerToys more robust in this situation.
monitor-info-report-14-11-2019-22-48-57.txt

@fvanroie Do you use the Microsoft Virtual Desktop feature? Click the Task View button next to the start menu flag, and at the top of the task view click into a new desktop? Is that something we have in common?

I update to v0.16.0 and the zones-settings.json only lists one monitor instead of the 2 connected:

    "devices": [
        {
            "device-id": "LGD032C#4&1177c581&0&UID67568640_2560_1440_{00000000-0000-0000-0000-000000000000}",
            "active-zoneset": {
                "uuid": "{EF161EE4-4949-41C2-866E-931510D469F6}",
                "type": "custom"
            },
            "editor-show-spacing": true,
            "editor-spacing": 2,
            "editor-zone-count": 2
        }
    ],

I'm still having the issue that both screens share the same layout no matter what.

Closing this in favor of the most recent https://github.com/microsoft/PowerToys/issues/6321

Anyone that is still experiencing this issue, can you please run the updated diagnostic tool that I've attached?
Thank you.

monitor_info_report1.1.zip

We have a private (unsigned) build with a fix that solve this problem in some cases.
If you can install an unsigned build, feel free to give it a try.
Before installing it, it's better to reset the FZ settings:

  • quit PowerToys
  • in command prompt run del %localappdata%\Microsoft\PowerToys\FancyZones
  • install the private build

PowerToysSetup-0.21.2-x64.zip

Was this page helpful?
0 / 5 - 0 ratings

Related issues

enricogior picture enricogior  路  3Comments

aminya picture aminya  路  3Comments

Martin-Hausleitner picture Martin-Hausleitner  路  3Comments

Garconis picture Garconis  路  3Comments

verglor picture verglor  路  3Comments