I figured out the issues with multiple windows and WPF. WPF passes in an override window to SwapChain Present when it wants to draw into a specific window. In Wine when swapchain_gl_present calls context_acquire the context returned is for the wrong window because it does not look at the override window of the swap chain. I can fix the issue but it requires modifying context_acquire to take the swap chain as a parameter. In the failure case there is no texture passed to context_acquire because the swap chain does not have a back buffer so I do not have a way to get the correct swap chain. Because there is no texture wined3d_context_gl_acquire uses the first swap chain of the device which is not the correct swap chain and has a different window.
I wanted to check and make sure that changing context_acquire to take a swap chain is a reasonable fix?
The signature would change from:
static inline struct wined3d_context *context_acquire(struct wined3d_device *device, struct wined3d_texture *texture, unsigned int sub_resource_idx)
to:
static inline struct wined3d_context *context_acquire(struct wined3d_device *device, struct wined3d_swapchain *swapchain, struct wined3d_texture *texture, unsigned int sub_resource_idx)
I would also need to change adapter_acquire_context on wined3d_adapter_ops to also take the swap chain. This will enable wined3d_context_gl_acquire to get the correct context by looking at the correct swapchain.
--Chris
-----Original Message----- From: wine-devel wine-devel-bounces@winehq.org On Behalf Of Christopher Cifra Sent: Friday, August 9, 2019 12:16 PM To: wine-devel@winehq.org Subject: [EXTERNAL] Wine for NET Core WPF Apps
Hi, I'm just getting started with Wine and am working on getting a few .NET Core WPF apps running on Linux with Wine. Surprisingly enough I was able to get a basic application working without too much difficulty. Here is an animated gif of a test app if you are interested: https://urldefense.com/v3/__https://ccifra.github.io/WPFOnLinux/WPFOnLinux.h... . It is running on a very slow VM so don't pay much attention to the performance.
To get this far I just needed to fix up some stubbed out methods in api-ms-win-crt-private-l1-1-0. I want to submit a patch with my changes and I was not sure what your testing requirements are when stubs are updated to point to existing methods? Are there examples of tests that I should follow?
I have run into one bug so far when the applications bring up multiple windows. Basically the contents of additional windows will render back into the first window. Input events like cursor interactions work correctly in the second window (if you know where to click). It does not seem to always happen, combo box dropdowns work for example, but it usually does. I have not been able to narrow the issue any further so I thought I would check to see if this is a known issue or if anyone had any pointers on where I can start looking. I don't know much about the graphics stack. I can also share a sample app which shows off the issue if anyone is interested in taking a look.
Please let me know if I should post this kinds of questions somewhere else.
Thanks for your help, --Chris