From 63ba9cccf28592f617a85022b9c6fc4cfdfe8d32 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Sun, 11 Dec 2022 17:29:17 +0100 Subject: [PATCH] Track max output scale. --- profiler/src/BackendWayland.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/profiler/src/BackendWayland.cpp b/profiler/src/BackendWayland.cpp index f05e82e4..39393038 100644 --- a/profiler/src/BackendWayland.cpp +++ b/profiler/src/BackendWayland.cpp @@ -54,6 +54,7 @@ struct Output wl_output* obj; }; static std::unordered_map> s_output; +static int s_maxScale = 1; static bool s_running = true; static int s_w, s_h; @@ -190,6 +191,12 @@ static void OutputMode( void*, struct wl_output* output, uint32_t flags, int32_t static void OutputDone( void*, struct wl_output* output ) { + int max = 1; + for( auto& out : s_output ) + { + if( out.second->scale > max ) max = out.second->scale; + } + s_maxScale = max; } static void OutputScale( void* data, struct wl_output* output, int32_t scale )