[PATCH 2/7] wined3d: Restore the display mode on focus loss (v2).

Henri Verbeet hverbeet at gmail.com
Mon Oct 6 08:48:59 CDT 2014


On 6 October 2014 13:42, Stefan Dösinger <stefan at codeweavers.com> wrote:
> +static BOOL wined3d_swapchain_mode_changed(const struct wined3d_swapchain *swapchain)
> +{
> +    return swapchain->desc.backbuffer_width != swapchain->original_mode.width
> +            || swapchain->desc.backbuffer_height != swapchain->original_mode.height
> +            || swapchain->desc.backbuffer_format != swapchain->original_mode.format_id
> +            || swapchain->desc.refresh_rate != swapchain->original_mode.refresh_rate;
> +}
> +
>  void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate)
>  {
>      if (!activate)
> +    {
> +        if (wined3d_swapchain_mode_changed(swapchain))
> +        {
> +            if (FAILED(wined3d_set_adapter_display_mode(swapchain->device->wined3d,
> +                    swapchain->device->adapter->ordinal, &swapchain->original_mode)))
> +                ERR("Failed to set display mode.\n");
> +
> +            swapchain->reapply_mode = TRUE;
This seems to imply that if an application created a fullscreen
swapchain at the current display resolution, but then some external
mode change happened, we should keep the mode from the external mode
change on focus loss, but then change it on reset. That may be
correct, but it's certainly more complicated than just resetting the
original mode on focus loss, and I don't see tests. As a follow up, it
would perhaps also be interesting to verify that in some of the places
where we're currently using "original_mode", we really shouldn't be
using EnumDisplaySettings() with ENUM_REGISTRY_SETTINGS instead.



More information about the wine-devel mailing list