diff --git a/src/backends/libinput/connection.cpp b/src/backends/libinput/connection.cpp index e49f7e6cb7..8d3c223369 100644 --- a/src/backends/libinput/connection.cpp +++ b/src/backends/libinput/connection.cpp @@ -287,10 +287,10 @@ void Connection::processEvents() break; } case LIBINPUT_EVENT_DEVICE_REMOVED: { - auto it = std::ranges::find_if(m_devices, [&event](Device *d) { + auto it = std::ranges::find_if(std::as_const(m_devices), [&event](Device *d) { return event->device() == d; }); - if (it == m_devices.end()) { + if (it == m_devices.cend()) { // we don't know this device break; } diff --git a/src/backends/x11/windowed/x11_windowed_backend.cpp b/src/backends/x11/windowed/x11_windowed_backend.cpp index 18e5e1e7d9..c8cf708f55 100644 --- a/src/backends/x11/windowed/x11_windowed_backend.cpp +++ b/src/backends/x11/windowed/x11_windowed_backend.cpp @@ -513,10 +513,10 @@ void X11WindowedBackend::updateWindowTitle() void X11WindowedBackend::handleClientMessage(xcb_client_message_event_t *event) { - auto it = std::ranges::find_if(m_outputs, [event](X11WindowedOutput *output) { + auto it = std::ranges::find_if(std::as_const(m_outputs), [event](X11WindowedOutput *output) { return output->window() == event->window; }); - if (it == m_outputs.end()) { + if (it == m_outputs.cend()) { return; } if (event->type == m_protocols && m_protocols != XCB_ATOM_NONE) {