[gtk/vulkan-no-layered-windows] gdkvulkancontext-win32.c: Suppress layered Windows on Vulkan
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/vulkan-no-layered-windows] gdkvulkancontext-win32.c: Suppress layered Windows on Vulkan
- Date: Tue, 26 Nov 2019 09:01:19 +0000 (UTC)
commit 9c5ea8eba4853c936fc30b5b53ccec47c058baa6
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Nov 26 16:07:08 2019 +0800
gdkvulkancontext-win32.c: Suppress layered Windows on Vulkan
The Vulkan renderer does not work well with layered windows enabled, so
turn it off when we successfully created the Vulkan context on Windows.
gdk/win32/gdkvulkancontext-win32.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/gdk/win32/gdkvulkancontext-win32.c b/gdk/win32/gdkvulkancontext-win32.c
index 583d762ecb..9588b5126b 100644
--- a/gdk/win32/gdkvulkancontext-win32.c
+++ b/gdk/win32/gdkvulkancontext-win32.c
@@ -40,7 +40,9 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
{
GdkSurface *window = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context));
GdkDisplay *display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
+ GdkWin32Surface *win32_surface = GDK_WIN32_SURFACE (window);
VkWin32SurfaceCreateInfoKHR info;
+ VkResult result;
info.sType = VK_STRUCTURE_TYPE_WIN32_SURFACE_CREATE_INFO_KHR;
info.pNext = NULL;
@@ -55,11 +57,19 @@ gdk_win32_vulkan_context_create_surface (GdkVulkanContext *context,
*/
gdk_display_sync (display);
- return GDK_VK_CHECK (vkCreateWin32SurfaceKHR,
- gdk_vulkan_context_get_instance (context),
- &info,
- NULL,
- surface);
+ result = GDK_VK_CHECK (vkCreateWin32SurfaceKHR,
+ gdk_vulkan_context_get_instance (context),
+ &info,
+ NULL,
+ surface);
+
+ if (result == VK_SUCCESS)
+ win32_surface->suppress_layered ++;
+
+ if (win32_surface->suppress_layered == 1)
+ _gdk_win32_surface_update_style_bits (window);
+
+ return result;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]