(forwarding to wine-devel as I forgot to do so in the reply)
---------- Forwarded message --------- From: Joel Leclerc meerkatanonymous@gmail.com Date: Thu, 3 Oct 2019 at 04:18 Subject: Re: [PATCH] Implement DwmIsCompositionEnabled To: Dmitry Timoshkov dmitry@baikal.ru
For that particular bug report just making DwmIsCompositionEnabled() return TRUE is enough according to the bug comments
The problem is that doing this might break other applications, since DWM is currently not fully implemented in Wine. Adding a registry value that is disabled by default more closely mirrors the way Windows does it (Windows uses this registry value to determine whether to enable composition or not), and will hopefully prevent regressions as well. Even if it's enabled by default, I believe using a registry value would still allow greater flexibility for the end-user if an error results due to this being enabled.
Besides, reading a DWORD value from the registry could be done in less lines of code and without passing not initialzied values to the registry APIs.
Unfortunately I'm not very familiar with Windows's API, and this is my first patch, so I'm not very familiar with Wine's codebase either. Could you share an example, or another function in Wine's code that implements this in a better way?
Thanks for reviewing this.
On Thu, 3 Oct 2019 at 03:36, Dmitry Timoshkov dmitry@baikal.ru wrote:
Joel Leclerc meerkatanonymous@gmail.com wrote:
For that particular bug report just making DwmIsCompositionEnabled() return TRUE is enough according to the bug comments, reading the value from registry doesn't add anything useful. Besides, reading a DWORD value from the registry could be done in less lines of code and without passing not initialzied values to the registry APIs.
-- Dmitry.
Anonymous Meerkat meerkatanonymous@gmail.com wrote:
For that particular bug report just making DwmIsCompositionEnabled() return TRUE is enough according to the bug comments
The problem is that doing this might break other applications, since DWM is currently not fully implemented in Wine. Adding a registry value that is disabled by default more closely mirrors the way Windows does it (Windows uses this registry value to determine whether to enable composition or not), and will hopefully prevent regressions as well. Even if it's enabled by default, I believe using a registry value would still allow greater flexibility for the end-user if an error results due to this being enabled.
Adding a winecfg option to reflect that registry value could make things for a user much easier.
Besides, reading a DWORD value from the registry could be done in less lines of code and without passing not initialzied values to the registry APIs.
Unfortunately I'm not very familiar with Windows's API, and this is my first patch, so I'm not very familiar with Wine's codebase either. Could you share an example, or another function in Wine's code that implements this in a better way?
Here is an example: https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/gdi32/gdiobj.c#l610
Adding a winecfg option to reflect that registry value could make things for a user much easier.
I agree. I was about to suggest the same, but I'll wait until a verdict is out on the registry patch before moving on to the user-interface component.
Here is an example: https://source.winehq.org/git/wine.git/blob/HEAD:/dlls/gdi32/gdiobj.c#l610
Thank you, I also missed a RegCloseKey call. I've submitted v2.