From c4c23b95741373d978834163edcd446b13f26370 Mon Sep 17 00:00:00 2001 From: Robbert van der Helm Date: Thu, 22 Jul 2021 15:46:15 +0200 Subject: [PATCH] Unify enter/focus event tracing --- src/wine-host/editor.cpp | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/wine-host/editor.cpp b/src/wine-host/editor.cpp index aaec1ae2..53011bd6 100644 --- a/src/wine-host/editor.cpp +++ b/src/wine-host/editor.cpp @@ -21,6 +21,7 @@ #include using namespace std::literals::chrono_literals; +using namespace std::literals::string_literals; // A catchable alternative to `assert()`. Normally all of our `assert(!error)` // should never fail, except for when Ardour hides the editor window without @@ -548,18 +549,12 @@ void Editor::handle_x11_events() noexcept { : reinterpret_cast( generic_event.get()) ->event; - - if (event_type == XCB_ENTER_NOTIFY) { - logger.log_editor_trace([&]() { - return "DEBUG: EnterNotify for window " + - std::to_string(window); - }); - } else { - logger.log_editor_trace([&]() { - return "DEBUG: FocusIn for window " + - std::to_string(window); - }); - } + logger.log_editor_trace([&]() { + return "DEBUG: "s + + (event_type == XCB_ENTER_NOTIFY ? "EnterNotify" + : "FocusIn") + + " for window " + std::to_string(window); + }); if (window == parent_window || window == wrapper_window.window) {