http://bugs.winehq.org/show_bug.cgi?id=34978
--- Comment #5 from Ken Thomases ken@codeweavers.com --- Created attachment 46935 --> http://bugs.winehq.org/attachment.cgi?id=46935 Kludgy implementation of EnumDisplayDevicesW()
Here's an implementation of EnumDisplayDevicesW() and some supporting functionality that gets DisplayFusion working properly with the Mac driver. It requires changes in the user driver, but I only made those changes in the Mac driver, so it's very likely that this will break the X11 driver.
I'm not 100% sure that I understand how this is supposed to behave on Windows. I thought I knew, but DisplayFusion continued to behave oddly until I changed some things.
I had thought that we could emulate a single video adapter and hang each display off of that. Like so for two displays:
EnumDisplayDevices(NULL, 0, ...) -> \.\DISPLAY1 (adapter) EnumDisplayDevices("\.\DISPLAY1", 0, ...) -> \.\DISPLAY1\Monitor0 (display) EnumDisplayDevices("\.\DISPLAY1", 1, ...) -> \.\DISPLAY1\Monitor1 (display) EnumDisplayDevices("\.\DISPLAY1", 2, ...) -> failure (no more displays) EnumDisplayDevices(NULL, 1, ...) -> failure (no more adapters)
However, DisplayFusion insists on interpreting that as the displays being mirrored/cloned. I've found somebody else with that interpretation[1].
In order to get separate displays, I had to emulate an adapter for each:
EnumDisplayDevices(NULL, 0, ...) -> \.\DISPLAY1 (adapter) EnumDisplayDevices("\.\DISPLAY1", 0, ...) -> \.\DISPLAY1\Monitor0 (display) EnumDisplayDevices("\.\DISPLAY1", 1, ...) -> failure (no more displays) EnumDisplayDevices(NULL, 1, ...) -> \.\DISPLAY2 (adapter) EnumDisplayDevices("\.\DISPLAY2", 0, ...) -> \.\DISPLAY2\Monitor0 (display) EnumDisplayDevices("\.\DISPLAY2", 1, ...) -> failure (no more displays) EnumDisplayDevices(NULL, 2, ...) -> failure (no more adapters)
Anyway, this patch is mostly about exploring. There will have to be a lot more work before anything like this can be submitted.
[1] http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/9ce34fd2-1264-4...