input: don't crash if the internal handle is nullptr (wheelEvent)

Apply the same fix as 4d9a0d23 to wheelEvent
wilder/Plasma/6.3
Alessandro Astone 1 year ago
parent 53d7f8d077
commit e0b554e67b
  1. 4
      src/input.cpp

@ -1239,6 +1239,10 @@ public:
return false; return false;
} }
QWindow *internal = static_cast<InternalWindow *>(input()->pointer()->focus())->handle(); QWindow *internal = static_cast<InternalWindow *>(input()->pointer()->focus())->handle();
if (!internal) {
// the handle can be nullptr if the tooltip gets closed while focus updates are blocked
return false;
}
const auto timestamp = std::chrono::duration_cast<std::chrono::milliseconds>(event->timestamp()); const auto timestamp = std::chrono::duration_cast<std::chrono::milliseconds>(event->timestamp());
QWindowSystemInterface::handleWheelEvent(internal, QWindowSystemInterface::handleWheelEvent(internal,
timestamp.count(), timestamp.count(),

Loading…
Cancel
Save