diff options
Diffstat (limited to 'src/win')
| -rw-r--r-- | src/win/gui/InputMethod.cpp | 7 | ||||
| -rw-r--r-- | src/win/gui/Window.cpp | 9 | 
2 files changed, 12 insertions, 4 deletions
diff --git a/src/win/gui/InputMethod.cpp b/src/win/gui/InputMethod.cpp index d6f2146d..34638516 100644 --- a/src/win/gui/InputMethod.cpp +++ b/src/win/gui/InputMethod.cpp @@ -3,6 +3,7 @@  #include "cru/common/Logger.hpp"  #include "cru/common/StringUtil.hpp"  #include "cru/platform/Check.hpp" +#include "cru/platform/gui/DebugFlags.hpp"  #include "cru/win/Exception.hpp"  #include "cru/win/gui/Window.hpp" @@ -246,8 +247,10 @@ void WinInputMethodContext::OnWindowNativeMessage(      case WM_IME_COMPOSITION: {        composition_event_.Raise(nullptr);        auto composition_text = GetCompositionText(); -      log::TagDebug(log_tag, u"WM_IME_COMPOSITION composition text:\n{}", -                    composition_text); +      if constexpr (DebugFlags::input_method) { +        log::TagDebug(log_tag, u"WM_IME_COMPOSITION composition text:\n{}", +                      composition_text); +      }        if (message.l_param & GCS_RESULTSTR) {          auto result_string = GetResultString();          text_event_.Raise(result_string); diff --git a/src/win/gui/Window.cpp b/src/win/gui/Window.cpp index dda8a36a..174b8931 100644 --- a/src/win/gui/Window.cpp +++ b/src/win/gui/Window.cpp @@ -4,6 +4,7 @@  #include "cru/common/Logger.hpp"  #include "cru/platform/Check.hpp"  #include "cru/platform/gui/Base.hpp" +#include "cru/platform/gui/DebugFlags.hpp"  #include "cru/win/graphics/direct/WindowPainter.hpp"  #include "cru/win/gui/Cursor.hpp"  #include "cru/win/gui/Exception.hpp" @@ -132,7 +133,9 @@ bool WinNativeWindow::ReleaseMouse() {  }  void WinNativeWindow::RequestRepaint() { -  log::TagDebug(log_tag, u"A repaint is requested."); +  if constexpr (DebugFlags::paint) { +    log::TagDebug(log_tag, u"A repaint is requested."); +  }    if (!::InvalidateRect(hwnd_, nullptr, FALSE))      throw Win32Error(::GetLastError(), "Failed to invalidate window.");    if (!::UpdateWindow(hwnd_)) @@ -376,7 +379,9 @@ void WinNativeWindow::OnDestroyInternal() {  void WinNativeWindow::OnPaintInternal() {    paint_event_.Raise(nullptr);    ValidateRect(hwnd_, nullptr); -  log::TagDebug(log_tag, u"A repaint is finished."); +  if constexpr (DebugFlags::paint) { +    log::TagDebug(log_tag, u"A repaint is finished."); +  }  }  void WinNativeWindow::OnResizeInternal(const int new_width,  | 
