[gtk+] vulkan: Handle changing window scale



commit 6560961c5967c8c6251842347cc31679c1a56b77
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Oct 28 11:57:53 2017 -0400

    vulkan: Handle changing window scale
    
    The code that checks for the proper size of the our swapchain
    was not taking window scale fully into account. With this change,
    setting the window scale to 2 in the inspector causes the window
    to grow and rendering to be scaled up as expected, with Vulkan,
    in the same way it already is with cairo.

 gdk/gdkvulkancontext.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/gdkvulkancontext.c b/gdk/gdkvulkancontext.c
index 8b6ffa6..f442534 100644
--- a/gdk/gdkvulkancontext.c
+++ b/gdk/gdkvulkancontext.c
@@ -195,8 +195,8 @@ gdk_vulkan_context_check_swapchain (GdkVulkanContext  *context,
   VkDevice device;
   guint i;
 
-  if (gdk_window_get_width (window) == priv->swapchain_width &&
-      gdk_window_get_height (window) == priv->swapchain_height)
+  if (gdk_window_get_width (window) * gdk_window_get_scale_factor (window) == priv->swapchain_width &&
+      gdk_window_get_height (window) * gdk_window_get_scale_factor (window) == priv->swapchain_height)
     return TRUE;
 
   device = gdk_vulkan_context_get_device (context);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]