diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-05-01 21:10:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-01 21:25:06 +0200 |
commit | 6cf59b6ae96aeeb8c0da957a07f913c4fa38467f (patch) | |
tree | b3f1691b59c3280993d4a8c2866f821ae15c1875 /Userland/Services/Taskbar | |
parent | 4e6f03a860595f9eb2628e12ddbd333e26b0622f (diff) | |
download | serenity-6cf59b6ae96aeeb8c0da957a07f913c4fa38467f.zip |
Everywhere: Turn #if *_DEBUG into dbgln_if/if constexpr
Diffstat (limited to 'Userland/Services/Taskbar')
-rw-r--r-- | Userland/Services/Taskbar/TaskbarWindow.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/Userland/Services/Taskbar/TaskbarWindow.cpp b/Userland/Services/Taskbar/TaskbarWindow.cpp index 25e25a2e2e..a6dd4da3f1 100644 --- a/Userland/Services/Taskbar/TaskbarWindow.cpp +++ b/Userland/Services/Taskbar/TaskbarWindow.cpp @@ -240,12 +240,12 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event) WindowIdentifier identifier { event.client_id(), event.window_id() }; switch (event.type()) { case GUI::Event::WM_WindowRemoved: { -#if EVENT_DEBUG - auto& removed_event = static_cast<GUI::WMWindowRemovedEvent&>(event); - dbgln("WM_WindowRemoved: client_id={}, window_id={}", - removed_event.client_id(), - removed_event.window_id()); -#endif + if constexpr (EVENT_DEBUG) { + auto& removed_event = static_cast<GUI::WMWindowRemovedEvent&>(event); + dbgln("WM_WindowRemoved: client_id={}, window_id={}", + removed_event.client_id(), + removed_event.window_id()); + } if (auto* window = WindowList::the().window(identifier)) remove_window_button(*window, true); WindowList::the().remove_window(identifier); @@ -253,13 +253,13 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event) break; } case GUI::Event::WM_WindowRectChanged: { -#if EVENT_DEBUG - auto& changed_event = static_cast<GUI::WMWindowRectChangedEvent&>(event); - dbgln("WM_WindowRectChanged: client_id={}, window_id={}, rect={}", - changed_event.client_id(), - changed_event.window_id(), - changed_event.rect()); -#endif + if constexpr (EVENT_DEBUG) { + auto& changed_event = static_cast<GUI::WMWindowRectChangedEvent&>(event); + dbgln("WM_WindowRectChanged: client_id={}, window_id={}, rect={}", + changed_event.client_id(), + changed_event.window_id(), + changed_event.rect()); + } break; } @@ -274,15 +274,15 @@ void TaskbarWindow::wm_event(GUI::WMEvent& event) case GUI::Event::WM_WindowStateChanged: { auto& changed_event = static_cast<GUI::WMWindowStateChangedEvent&>(event); -#if EVENT_DEBUG - dbgln("WM_WindowStateChanged: client_id={}, window_id={}, title={}, rect={}, is_active={}, is_minimized={}", - changed_event.client_id(), - changed_event.window_id(), - changed_event.title(), - changed_event.rect(), - changed_event.is_active(), - changed_event.is_minimized()); -#endif + if constexpr (EVENT_DEBUG) { + dbgln("WM_WindowStateChanged: client_id={}, window_id={}, title={}, rect={}, is_active={}, is_minimized={}", + changed_event.client_id(), + changed_event.window_id(), + changed_event.title(), + changed_event.rect(), + changed_event.is_active(), + changed_event.is_minimized()); + } if (changed_event.window_type() != GUI::WindowType::Normal || changed_event.is_frameless()) { if (auto* window = WindowList::the().window(identifier)) remove_window_button(*window, false); |