From 328f51ce10c206f5ae6591b42c9c2dfae7f575d5 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 18 Apr 2022 11:29:51 +0300 Subject: [PATCH] Remove some AbstractClient plumbing casts in input.cpp --- src/input.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 61d3a7d190..9b308e0c3d 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -350,10 +350,9 @@ public: return false; } - auto t = input()->findToplevel(event->globalPos()); - auto client = static_cast(t && t->isClient() ? t : nullptr); - if (client && client->isLockScreen()) { - workspace()->activateClient(client); + auto window = input()->findToplevel(event->globalPos()); + if (window->isClient() && window->isLockScreen()) { + workspace()->activateClient(window); } auto seat = waylandServer()->seat(); @@ -3300,12 +3299,11 @@ void InputDeviceHandler::updateFocus() void InputDeviceHandler::updateDecoration() { Decoration::DecoratedClientImpl *decoration = nullptr; - auto t = m_hover.window.data(); - auto ac = static_cast(t && t->isClient() ? t : nullptr); - if (ac && ac->decoratedClient()) { - if (!ac->clientGeometry().contains(position().toPoint())) { + auto hover = m_hover.window.data(); + if (hover && hover->decoratedClient()) { + if (!hover->clientGeometry().contains(position().toPoint())) { // input device above decoration - decoration = ac->decoratedClient(); + decoration = hover->decoratedClient(); } }