ScottyMac52 / MFDMF

Multi-Function Display Management Framework
MIT License
1 stars 0 forks source link

displays.json doesn't allow more than 5 configurations #16

Closed HomeFries94 closed 3 years ago

HomeFries94 commented 3 years ago

The following file contents worked fine:

[
    {
        "name": "Main",
        "width": 1920,
        "height": 1080
    },
    {
        "name": "LMFD",
        "width": 450,
        "height": 450,
        "left": 1920,
        "top": 5,
        "xOffsetStart": 101,
        "xOffsetFinish": 773,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "RMFD",
        "width": 450,
        "height": 450,
        "left": 3390,
        "top":  5,
        "xOffsetStart": 903,
        "xOffsetFinish": 1575,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "CMFD",
        "width": 450,
        "height": 450,
        "left": 1920,
        "top":  5,
        "xOffsetStart": 101,
        "xOffsetFinish": 773,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "WHKEY",
        "width": 1600,
        "height": 1200,
        "left": 3840,
        "top": 0,
        "xOffsetStart": 0,
        "yOffsetStart": 0,
        "xOffsetFinish": 3330,
        "yOffsetFinish": 2295,
        "opacity": 1.0
    }
]

Copying the CMFD entry and renaming it XMFD prevented the program from loading (not even an error dialog) This is the file contents of display.json that prevented the load:

[
    {
        "name": "Main",
        "width": 1920,
        "height": 1080
    },
    {
        "name": "LMFD",
        "width": 450,
        "height": 450,
        "left": 1920,
        "top": 5,
        "xOffsetStart": 101,
        "xOffsetFinish": 773,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "RMFD",
        "width": 450,
        "height": 450,
        "left": 3390,
        "top":  5,
        "xOffsetStart": 903,
        "xOffsetFinish": 1575,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "CMFD",
        "width": 450,
        "height": 450,
        "left": 1920,
        "top":  5,
        "xOffsetStart": 101,
        "xOffsetFinish": 773,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "XMFD",
        "width": 450,
        "height": 450,
        "left": 1920,
        "top":  5,
        "xOffsetStart": 101,
        "xOffsetFinish": 773,
        "yOffsetStart": 250,
        "yOffsetFinish": 897,
        "opacity": 1.0
    },
    {
        "name": "WHKEY",
        "width": 1600,
        "height": 1200,
        "left": 3840,
        "top": 0,
        "xOffsetStart": 0,
        "yOffsetStart": 0,
        "xOffsetFinish": 3330,
        "yOffsetFinish": 2295,
        "opacity": 1.0
    }
]

And this was the message in the logfile:

[2021-09-21 23:51:24.847 -04:00] [Warning] [MFDMFApp.MainApp] [Starting the main window]
[2021-09-21 23:51:27.101 -04:00] [Warning] [MFDMFApp.MainApp] [The applictaion is exiting with exitCode: 0]
ScottyMac52 commented 3 years ago

I was able to reproduce this. For some reason trying to read the text contents of the file asynchronously was failing, in fact it was NEVER returning to the calling thread! I added the .ConfigureAwait(false) fluent call and now it returns to the calling thread as expected. This will be fixed in the next version.