From 3e6d9cb7a88dc14fb7ab1aa7a21f8fd3f802f55f Mon Sep 17 00:00:00 2001 From: Matthew Schwartz Date: Sat, 1 Feb 2025 19:04:37 -0800 Subject: [PATCH] layer: identify 32-bit and 64-bit layer logs Leave some breadcrumbs to figure out whether the logs we're getting come from the 32-bit or 64-bit layer. ARM/aarch64 and FreeBSD logs will appear without a bit suffix. --- layer/VkLayer_FROG_gamescope_wsi.cpp | 93 ++++++++++++++++------------ layer/xcb_helpers.hpp | 27 +++++--- 2 files changed, 73 insertions(+), 47 deletions(-) diff --git a/layer/VkLayer_FROG_gamescope_wsi.cpp b/layer/VkLayer_FROG_gamescope_wsi.cpp index 5bd1408bf7..38782f043b 100644 --- a/layer/VkLayer_FROG_gamescope_wsi.cpp +++ b/layer/VkLayer_FROG_gamescope_wsi.cpp @@ -24,6 +24,19 @@ #include "../src/messagey.h" +// For layer logging. +#if __linux__ +#if __x86_64__ +#define WSI_LAYER_INFO "[Gamescope WSI 64-bit] " +#elif __i386__ +#define WSI_LAYER_INFO "[Gamescope WSI 32-bit] " +#else +#define WSI_LAYER_INFO "[Gamescope WSI] " +#endif +#else +#define WSI_LAYER_INFO "[Gamescope WSI] " +#endif + using namespace std::literals; namespace GamescopeWSILayer { @@ -150,17 +163,17 @@ namespace GamescopeWSILayer { static uint32_t getMinImageCount() { static uint32_t s_minImageCount = []() -> uint32_t { if (auto minCount = parseEnv("GAMESCOPE_WSI_MIN_IMAGE_COUNT")) { - fprintf(stderr, "[Gamescope WSI] minImageCount overridden by GAMESCOPE_WSI_MIN_IMAGE_COUNT: %u\n", *minCount); + fprintf(stderr, WSI_LAYER_INFO "minImageCount overridden by GAMESCOPE_WSI_MIN_IMAGE_COUNT: %u\n", *minCount); return *minCount; } if (auto minCount = parseEnv("vk_wsi_override_min_image_count")) { - fprintf(stderr, "[Gamescope WSI] minImageCount overridden by vk_wsi_override_min_image_count: %u\n", *minCount); + fprintf(stderr, WSI_LAYER_INFO "minImageCount overridden by vk_wsi_override_min_image_count: %u\n", *minCount); return *minCount; } if (auto minCount = parseEnv("vk_x11_override_min_image_count")) { - fprintf(stderr, "[Gamescope WSI] minImageCount overridden by vk_x11_override_min_image_count: %u\n", *minCount); + fprintf(stderr, WSI_LAYER_INFO "minImageCount overridden by vk_x11_override_min_image_count: %u\n", *minCount); return *minCount; } @@ -233,13 +246,13 @@ namespace GamescopeWSILayer { { const char *mesaExecutableEnv = getenv("MESA_DRICONF_EXECUTABLE_OVERRIDE"); if (mesaExecutableEnv && *mesaExecutableEnv) { - fprintf(stderr, "[Gamescope WSI] Executable name overriden by MESA_DRICONF_EXECUTABLE_OVERRIDE: %s\n", mesaExecutableEnv); + fprintf(stderr, WSI_LAYER_INFO "Executable name overriden by MESA_DRICONF_EXECUTABLE_OVERRIDE: %s\n", mesaExecutableEnv); return mesaExecutableEnv; } const char *mesaProcessName = getenv("MESA_PROCESS_NAME"); if (mesaProcessName && *mesaProcessName) { - fprintf(stderr, "[Gamescope WSI] Executable name overriden by MESA_PROCESS_NAME: %s\n", mesaExecutableEnv); + fprintf(stderr, WSI_LAYER_INFO "Executable name overriden by MESA_PROCESS_NAME: %s\n", mesaExecutableEnv); return mesaProcessName; } @@ -250,7 +263,7 @@ namespace GamescopeWSILayer { free(programNameCStr); } - fprintf(stderr, "[Gamescope WSI] Executable name: %s\n", name.c_str()); + fprintf(stderr, WSI_LAYER_INFO "Executable name: %s\n", name.c_str()); return name; }(); @@ -435,7 +448,7 @@ namespace GamescopeWSILayer { auto largestObscuringWindowSize = xcb::getLargestObscuringChildWindowSize(connection, window); auto toplevelWindow = xcb::getToplevelWindow(connection, window); if (!rect || !largestObscuringWindowSize || !toplevelWindow) { - fprintf(stderr, "[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "canBypassXWayland: failed to get window info for window 0x%x.\n", window); return false; } @@ -443,7 +456,7 @@ namespace GamescopeWSILayer { auto toplevelRect = xcb::getWindowRect(connection, *toplevelWindow); if (!toplevelRect) { - fprintf(stderr, "[Gamescope WSI] canBypassXWayland: failed to get window info for window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "canBypassXWayland: failed to get window info for window 0x%x.\n", window); return false; } @@ -459,7 +472,7 @@ namespace GamescopeWSILayer { // (There can be dummy composite redirect windows and whatever.) if (largestObscuringWindowSize->width > 1 || largestObscuringWindowSize->height > 1) { #if GAMESCOPE_WSI_BYPASS_DEBUG - fprintf(stderr, "[Gamescope WSI] Largest obscuring window size: %u %u\n", largestObscuringWindowSize->width, largestObscuringWindowSize->height); + fprintf(stderr, WSI_LAYER_INFO "Largest obscuring window size: %u %u\n", largestObscuringWindowSize->width, largestObscuringWindowSize->height); #endif return false; } @@ -475,7 +488,7 @@ namespace GamescopeWSILayer { iabs(int32_t(toplevelRect->extent.width) - int32_t(rect->extent.width)) > 2 || iabs(int32_t(toplevelRect->extent.height) - int32_t(rect->extent.height)) > 2) { #if GAMESCOPE_WSI_BYPASS_DEBUG - fprintf(stderr, "[Gamescope WSI] Not within 1px margin of error. Offset: %d %d Extent: %u %u vs %u %u\n", + fprintf(stderr, WSI_LAYER_INFO "Not within 1px margin of error. Offset: %d %d Extent: %u %u vs %u %u\n", rect->offset.x, rect->offset.y, toplevelRect->extent.width, toplevelRect->extent.height, rect->extent.width, rect->extent.height); @@ -547,7 +560,7 @@ namespace GamescopeWSILayer { std::unique_lock lock(*swapchain->presentTimingMutex); swapchain->refreshCycle = (uint64_t(refresh_cycle_hi) << 32) | refresh_cycle_lo; } - fprintf(stderr, "[Gamescope WSI] Swapchain recieved new refresh cycle: %.2fms\n", swapchain->refreshCycle / 1'000'000.0); + fprintf(stderr, WSI_LAYER_INFO "Swapchain recieved new refresh cycle: %.2fms\n", swapchain->refreshCycle / 1'000'000.0); }, .retired = []( @@ -557,7 +570,7 @@ namespace GamescopeWSILayer { { swapchain->retired = true; } - fprintf(stderr, "[Gamescope WSI] Swapchain retired\n"); + fprintf(stderr, WSI_LAYER_INFO "Swapchain retired\n"); }, }; @@ -596,20 +609,20 @@ namespace GamescopeWSILayer { wl_display *display = wl_display_connect(gamescopeWaylandSocket()); if (!display) { - fprintf(stderr, "[Gamescope WSI] Failed to connect to gamescope socket: %s. Bypass layer will be unavailable.\n", gamescopeWaylandSocket()); + fprintf(stderr, WSI_LAYER_INFO "Failed to connect to gamescope socket: %s. Bypass layer will be unavailable.\n", gamescopeWaylandSocket()); return result; } { if (pCreateInfo->pApplicationInfo) { - fprintf(stderr, "[Gamescope WSI] Application info:\n"); + fprintf(stderr, WSI_LAYER_INFO "Application info:\n"); fprintf(stderr, " pApplicationName: %s\n", pCreateInfo->pApplicationInfo->pApplicationName); fprintf(stderr, " applicationVersion: %u\n", pCreateInfo->pApplicationInfo->applicationVersion); fprintf(stderr, " pEngineName: %s\n", pCreateInfo->pApplicationInfo->pEngineName); fprintf(stderr, " engineVersion: %u\n", pCreateInfo->pApplicationInfo->engineVersion); fprintf(stderr, " apiVersion: %u\n", pCreateInfo->pApplicationInfo->apiVersion); } else { - fprintf(stderr, "[Gamescope WSI] No application info given.\n"); + fprintf(stderr, WSI_LAYER_INFO "No application info given.\n"); } } @@ -663,7 +676,7 @@ namespace GamescopeWSILayer { vkroots::ChainPatcher maintenance1Patcher(&deviceCreateInfo, [&](VkPhysicalDeviceSwapchainMaintenance1FeaturesEXT *pMaintenance1) { - fprintf(stderr, "[Gamescope WSI] Forcing on VK_EXT_swapchain_maintenance1.\n"); + fprintf(stderr, WSI_LAYER_INFO "Forcing on VK_EXT_swapchain_maintenance1.\n"); pMaintenance1->swapchainMaintenance1 = VK_TRUE; return true; }); @@ -735,7 +748,7 @@ namespace GamescopeWSILayer { GamescopeWaylandObjects waylandObjects = GamescopeWaylandObjects::get(pCreateInfo->display); if (!waylandObjects.valid()) { - fprintf(stderr, "[Gamescope WSI] Failed to get Wayland objects\n"); + fprintf(stderr, WSI_LAYER_INFO "Failed to get Wayland objects\n"); return VK_ERROR_SURFACE_LOST_KHR; } @@ -975,17 +988,17 @@ namespace GamescopeWSILayer { xcb_window_t window, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface) { - fprintf(stderr, "[Gamescope WSI] Creating Gamescope surface: xid: 0x%x\n", window); + fprintf(stderr, WSI_LAYER_INFO "Creating Gamescope surface: xid: 0x%x\n", window); GamescopeWaylandObjects waylandObjects = GamescopeWaylandObjects::get(gamescopeInstance->display); if (!waylandObjects.valid()) { - fprintf(stderr, "[Gamescope WSI] Failed to get Wayland objects\n"); + fprintf(stderr, WSI_LAYER_INFO "Failed to get Wayland objects\n"); return VK_ERROR_SURFACE_LOST_KHR; } wl_surface* waylandSurface = wl_compositor_create_surface(waylandObjects.compositor); if (!waylandSurface) { - fprintf(stderr, "[Gamescope WSI] Failed to create wayland surface - xid: 0x%x\n", window); + fprintf(stderr, WSI_LAYER_INFO "Failed to create wayland surface - xid: 0x%x\n", window); return VK_ERROR_SURFACE_LOST_KHR; } @@ -1009,7 +1022,7 @@ namespace GamescopeWSILayer { VkResult result = pDispatch->CreateWaylandSurfaceKHR(instance, &waylandCreateInfo, pAllocator, pSurface); if (result != VK_SUCCESS) { - fprintf(stderr, "[Gamescope WSI] Failed to create Vulkan wayland surface - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), window); + fprintf(stderr, WSI_LAYER_INFO "Failed to create Vulkan wayland surface - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), window); return result; } @@ -1023,11 +1036,11 @@ namespace GamescopeWSILayer { VkSurfaceKHR fallbackSurface = VK_NULL_HANDLE; result = pDispatch->CreateXcbSurfaceKHR(instance, &xcbCreateInfo, pAllocator, &fallbackSurface); if (result != VK_SUCCESS) { - fprintf(stderr, "[Gamescope WSI] Failed to create Vulkan xcb (fallback) surface - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), window); + fprintf(stderr, WSI_LAYER_INFO "Failed to create Vulkan xcb (fallback) surface - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), window); return result; } - fprintf(stderr, "[Gamescope WSI] Made gamescope surface for xid: 0x%x\n", window); + fprintf(stderr, WSI_LAYER_INFO "Made gamescope surface for xid: 0x%x\n", window); auto gamescopeSurface = GamescopeSurface::create(*pSurface, GamescopeSurfaceData { .instance = instance, .display = gamescopeInstance->display, @@ -1046,7 +1059,7 @@ namespace GamescopeWSILayer { } static void DumpGamescopeSurfaceState(GamescopeInstance& instance, GamescopeSurface& surface) { - fprintf(stderr, "[Gamescope WSI] Surface state:\n"); + fprintf(stderr, WSI_LAYER_INFO "Surface state:\n"); fprintf(stderr, " steam app id: %u\n", instance->appId); fprintf(stderr, " window xid: 0x%x\n", surface->window); fprintf(stderr, " wayland surface res id: %u\n", wl_proxy_get_id(reinterpret_cast(surface->surface))); @@ -1076,9 +1089,9 @@ namespace GamescopeWSILayer { gamescope_swapchain_destroy(state->object); } GamescopeSwapchain::remove(swapchain); - fprintf(stderr, "[Gamescope WSI] Destroying swapchain: %p\n", reinterpret_cast(swapchain)); + fprintf(stderr, WSI_LAYER_INFO "Destroying swapchain: %p\n", reinterpret_cast(swapchain)); pDispatch->DestroySwapchainKHR(device, swapchain, pAllocator); - fprintf(stderr, "[Gamescope WSI] Destroyed swapchain: %p\n", reinterpret_cast(swapchain)); + fprintf(stderr, WSI_LAYER_INFO "Destroyed swapchain: %p\n", reinterpret_cast(swapchain)); } static VkResult CreateSwapchainKHR( @@ -1158,7 +1171,7 @@ namespace GamescopeWSILayer { minImageCount = std::max(getMinImageCount(), minImageCount); swapchainInfo.minImageCount = minImageCount; - fprintf(stderr, "[Gamescope WSI] Creating swapchain for xid: 0x%0x - oldSwapchain: %p - provided minImageCount: %u - minImageCount: %u - format: %s - colorspace: %s - flip: %s\n", + fprintf(stderr, WSI_LAYER_INFO "Creating swapchain for xid: 0x%0x - oldSwapchain: %p - provided minImageCount: %u - minImageCount: %u - format: %s - colorspace: %s - flip: %s\n", gamescopeSurface->window, reinterpret_cast(pCreateInfo->oldSwapchain), pCreateInfo->minImageCount, @@ -1183,7 +1196,7 @@ namespace GamescopeWSILayer { &VkSurfaceFormatKHR::format) ; if (!supportedSwapchainFormat) { - fprintf(stderr, "[Gamescope WSI] Refusing to make swapchain (unsupported VkFormat) for xid: 0x%0x - format: %s - colorspace: %s - flip: %s\n", + fprintf(stderr, WSI_LAYER_INFO "Refusing to make swapchain (unsupported VkFormat) for xid: 0x%0x - format: %s - colorspace: %s - flip: %s\n", gamescopeSurface->window, vkroots::helpers::enumString(pCreateInfo->imageFormat), vkroots::helpers::enumString(pCreateInfo->imageColorSpace), @@ -1197,7 +1210,7 @@ namespace GamescopeWSILayer { if (!gamescopeSurface->isWayland()) { auto oServerId = xcb::getPropertyValue(gamescopeSurface->connection, "GAMESCOPE_XWAYLAND_SERVER_ID"sv); if (!oServerId) { - fprintf(stderr, "[Gamescope WSI] Failed to get Xwayland server id. Failing swapchain creation.\n"); + fprintf(stderr, WSI_LAYER_INFO "Failed to get Xwayland server id. Failing swapchain creation.\n"); return VK_ERROR_SURFACE_LOST_KHR; } serverId = *oServerId; @@ -1205,13 +1218,13 @@ namespace GamescopeWSILayer { auto gamescopeInstance = GamescopeInstance::get(gamescopeSurface->instance); if (!gamescopeInstance) { - fprintf(stderr, "[Gamescope WSI] CreateSwapchainKHR: Instance for swapchain was already destroyed. (App use after free).\n"); + fprintf(stderr, WSI_LAYER_INFO "CreateSwapchainKHR: Instance for swapchain was already destroyed. (App use after free).\n"); return VK_ERROR_SURFACE_LOST_KHR; } VkResult result = pDispatch->CreateSwapchainKHR(device, &swapchainInfo, pAllocator, pSwapchain); if (result != VK_SUCCESS) { - fprintf(stderr, "[Gamescope WSI] Failed to create swapchain - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), gamescopeSurface->window); + fprintf(stderr, WSI_LAYER_INFO "Failed to create swapchain - vr: %s xid: 0x%x\n", vkroots::helpers::enumString(result), gamescopeSurface->window); return result; } @@ -1239,7 +1252,7 @@ namespace GamescopeWSILayer { uint32_t imageCount = 0; pDispatch->GetSwapchainImagesKHR(device, *pSwapchain, &imageCount, nullptr); - fprintf(stderr, "[Gamescope WSI] Created swapchain for xid: 0x%0x swapchain: %p - imageCount: %u\n", + fprintf(stderr, WSI_LAYER_INFO "Created swapchain for xid: 0x%0x swapchain: %p - imageCount: %u\n", gamescopeSurface->window, reinterpret_cast(*pSwapchain), imageCount); @@ -1310,7 +1323,7 @@ namespace GamescopeWSILayer { assert(pPresentTimes->swapchainCount == presentInfo.swapchainCount); #if GAMESCOPE_WSI_DISPLAY_TIMING_DEBUG - fprintf(stderr, "[Gamescope WSI] QueuePresentKHR: presentID: %u - desiredPresentTime: %lu - now: %lu\n", pPresentTimes->pTimes[i].presentID, pPresentTimes->pTimes[i].desiredPresentTime, getTimeMonotonic()); + fprintf(stderr, WSI_LAYER_INFO "QueuePresentKHR: presentID: %u - desiredPresentTime: %lu - now: %lu\n", pPresentTimes->pTimes[i].presentID, pPresentTimes->pTimes[i].desiredPresentTime, getTimeMonotonic()); #endif gamescope_swapchain_set_present_time( gamescopeSwapchain->object, @@ -1408,13 +1421,13 @@ namespace GamescopeWSILayer { // exposed as supported in order for them to handle presentation latency like they // would as in FIFO mode. if (frameLimiterAware && gamescopeSwapchain->forceFifo != forceFifo) { - fprintf(stderr, "[Gamescope WSI] Forcing swapchain recreation as frame limiter changed, and we want the app to know the exposed modes changed.\n"); + fprintf(stderr, WSI_LAYER_INFO "Forcing swapchain recreation as frame limiter changed, and we want the app to know the exposed modes changed.\n"); UpdateSwapchainResult(VK_ERROR_OUT_OF_DATE_KHR); } auto gamescopeSurface = GamescopeSurface::get(gamescopeSwapchain->surface); if (!gamescopeSurface) { - fprintf(stderr, "[Gamescope WSI] QueuePresentKHR: Surface for swapchain %u was already destroyed. (App use after free).\n", i); + fprintf(stderr, WSI_LAYER_INFO "QueuePresentKHR: Surface for swapchain %u was already destroyed. (App use after free).\n", i); abort(); continue; } @@ -1438,7 +1451,7 @@ namespace GamescopeWSILayer { if (windowSizeChanged) UpdateSwapchainResult(VK_ERROR_OUT_OF_DATE_KHR); } else { - fprintf(stderr, "[Gamescope WSI] QueuePresentKHR: Failed to get cached window size for swapchain %u\n", i); + fprintf(stderr, WSI_LAYER_INFO "QueuePresentKHR: Failed to get cached window size for swapchain %u\n", i); } } } @@ -1456,7 +1469,7 @@ namespace GamescopeWSILayer { for (uint32_t i = 0; i < swapchainCount; i++) { auto gamescopeSwapchain = GamescopeSwapchain::get(pSwapchains[i]); if (!gamescopeSwapchain) { - fprintf(stderr, "[Gamescope WSI] SetHdrMetadataEXT: Swapchain %u does not support HDR.\n", i); + fprintf(stderr, WSI_LAYER_INFO "SetHdrMetadataEXT: Swapchain %u does not support HDR.\n", i); continue; } @@ -1476,7 +1489,7 @@ namespace GamescopeWSILayer { nits_to_u16(metadata.maxContentLightLevel), nits_to_u16(metadata.maxFrameAverageLightLevel)); - fprintf(stderr, "[Gamescope WSI] VkHdrMetadataEXT: display primaries:\n"); + fprintf(stderr, WSI_LAYER_INFO "VkHdrMetadataEXT: display primaries:\n"); fprintf(stderr, " r: %.4g %.4g\n", metadata.displayPrimaryRed.x, metadata.displayPrimaryRed.y); fprintf(stderr, " g: %.4g %.4g\n", metadata.displayPrimaryGreen.x, metadata.displayPrimaryGreen.y); fprintf(stderr, " b: %.4g %.4g\n", metadata.displayPrimaryBlue.x, metadata.displayPrimaryBlue.y); @@ -1495,7 +1508,7 @@ namespace GamescopeWSILayer { VkPastPresentationTimingGOOGLE* pPresentationTimings) { auto gamescopeSwapchain = GamescopeSwapchain::get(swapchain); if (!gamescopeSwapchain) { - fprintf(stderr, "[Gamescope WSI] GetPastPresentationTimingGOOGLE: Not a gamescope swapchain.\n"); + fprintf(stderr, WSI_LAYER_INFO "GetPastPresentationTimingGOOGLE: Not a gamescope swapchain.\n"); return VK_ERROR_SURFACE_LOST_KHR; } @@ -1522,7 +1535,7 @@ namespace GamescopeWSILayer { VkRefreshCycleDurationGOOGLE* pDisplayTimingProperties) { auto gamescopeSwapchain = GamescopeSwapchain::get(swapchain); if (!gamescopeSwapchain) { - fprintf(stderr, "[Gamescope WSI] GetRefreshCycleDurationGOOGLE: Not a gamescope swapchain.\n"); + fprintf(stderr, WSI_LAYER_INFO "GetRefreshCycleDurationGOOGLE: Not a gamescope swapchain.\n"); return VK_ERROR_SURFACE_LOST_KHR; } diff --git a/layer/xcb_helpers.hpp b/layer/xcb_helpers.hpp index 8fac5635b3..ec43f4b162 100644 --- a/layer/xcb_helpers.hpp +++ b/layer/xcb_helpers.hpp @@ -5,6 +5,19 @@ #include #include +// For layer logging. +#if __linux__ +#if __x86_64__ +#define WSI_LAYER_INFO "[Gamescope WSI 64-bit] " +#elif __i386__ +#define WSI_LAYER_INFO "[Gamescope WSI 32-bit] " +#else +#define WSI_LAYER_INFO "[Gamescope WSI] " +#endif +#else +#define WSI_LAYER_INFO "[Gamescope WSI] " +#endif + namespace xcb { struct ReplyDeleter { @@ -21,7 +34,7 @@ namespace xcb { xcb_intern_atom_cookie_t cookie = xcb_intern_atom(connection, false, name.length(), name.data()); auto reply = Reply{ xcb_intern_atom_reply(connection, cookie, nullptr) }; if (!reply) { - fprintf(stderr, "[Gamescope WSI] Failed to get xcb atom.\n"); + fprintf(stderr, WSI_LAYER_INFO "Failed to get xcb atom.\n"); return std::nullopt; } xcb_atom_t atom = reply->atom; @@ -37,12 +50,12 @@ namespace xcb { xcb_get_property_cookie_t cookie = xcb_get_property(connection, false, screen->root, atom, XCB_ATOM_CARDINAL, 0, sizeof(T) / sizeof(uint32_t)); auto reply = Reply{ xcb_get_property_reply(connection, cookie, nullptr) }; if (!reply) { - fprintf(stderr, "[Gamescope WSI] Failed to read T root window property.\n"); + fprintf(stderr, WSI_LAYER_INFO "Failed to read T root window property.\n"); return std::nullopt; } if (reply->type != XCB_ATOM_CARDINAL) { - fprintf(stderr, "[Gamescope WSI] Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.\n"); + fprintf(stderr, WSI_LAYER_INFO "Atom of T was wrong type. Expected XCB_ATOM_CARDINAL.\n"); return std::nullopt; } @@ -65,7 +78,7 @@ namespace xcb { auto reply = Reply{ xcb_query_tree_reply(connection, cookie, nullptr) }; if (!reply) { - fprintf(stderr, "[Gamescope WSI] getToplevelWindow: xcb_query_tree failed for window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "getToplevelWindow: xcb_query_tree failed for window 0x%x.\n", window); return std::nullopt; } @@ -80,7 +93,7 @@ namespace xcb { xcb_get_geometry_cookie_t cookie = xcb_get_geometry(connection, window); auto reply = Reply{ xcb_get_geometry_reply(connection, cookie, nullptr) }; if (!reply) { - fprintf(stderr, "[Gamescope WSI] getWindowRect: xcb_get_geometry failed for window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "getWindowRect: xcb_get_geometry failed for window 0x%x.\n", window); return std::nullopt; } @@ -116,13 +129,13 @@ namespace xcb { auto reply = Reply{ xcb_query_tree_reply(connection, cookie, nullptr) }; if (!reply) { - fprintf(stderr, "[Gamescope WSI] getLargestObscuringWindowSize: xcb_query_tree failed for window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "getLargestObscuringWindowSize: xcb_query_tree failed for window 0x%x.\n", window); return std::nullopt; } auto ourRect = getWindowRect(connection, window); if (!ourRect) { - fprintf(stderr, "[Gamescope WSI] getLargestObscuringWindowSize: getWindowRect failed for main window 0x%x.\n", window); + fprintf(stderr, WSI_LAYER_INFO "getLargestObscuringWindowSize: getWindowRect failed for main window 0x%x.\n", window); return std::nullopt; }