Skip to content

Commit

Permalink
vulkan: Handle changing window scale
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthias Clasen committed Oct 28, 2017
1 parent dc0570c commit 6560961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gdk/gdkvulkancontext.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6560961

Please sign in to comment.